From: Mark Mitchell Date: Sun, 7 Sep 2003 20:54:11 +0000 (+0000) Subject: re PR c++/12181 (Wrong code with comma operator and c++) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ef0aa7b3b2d120b33b7852e6377c5536a677e6c;p=gcc.git re PR c++/12181 (Wrong code with comma operator and c++) PR c++/12181 * g++.dg/expr/comma1.C: New test. From-SVN: r71182 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 11de2d92f36..51a01940bdf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-09-07 Mark Mitchell + + PR c++/12181 + * g++.dg/expr/comma1.C: New test. + 2003-09-06 Mark Mitchell PR c++/11867 diff --git a/gcc/testsuite/g++.dg/expr/comma1.C b/gcc/testsuite/g++.dg/expr/comma1.C new file mode 100644 index 00000000000..5424ce1a84e --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/comma1.C @@ -0,0 +1,21 @@ +// { dg-do run } + +extern "C" void abort (); + +struct gtst +{ + unsigned char data[2]; +}; + +static struct gtst s; + +int main(int argc, char *argv[]) +{ + unsigned char * pc; + struct gtst * ps; + ps = &s; + pc = (ps->data[0]='A', ps->data); + if (&s.data[0] != pc) + abort(); + return 0; +}