Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900331_02.C
blobf4d69fdca970e0fe74c03513416aa4bff191ed68
1 // { dg-do run  }
2 // g++ 1.37.1 bug 900331_02
4 // g++ fails to treat conditional expressions which yield composite type
5 // (i.e. struct type, union type, or class type) lvalues as if they did
6 // in fact yield lvalues in all cases.
8 // Cfront 2.0 passes this test.
10 // keywords: conditional operator?:, lvalues, composite types
12 struct struct0 {
13   int data_member;
16 struct0 object0;
17 struct0 object1;
18 struct0 object2;
20 int i;
22 void function0 ()
24   (i ? object0 : object1).data_member = 99;     // { dg-bogus "" } 
25   (i ? object0 : object1) = object2;            // { dg-bogus "" } 
28 int main () { return 0; }