2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900331_03.C
blobf59f107e1b21b19ec703eb7e12b416fb462cd8aa
1 // { dg-do run  }
2 // { dg-options "" }
3 // g++ 1.37.1 bug 900331_03
5 // Special Options: -ansi
7 // The following code causes g++ to abort.
9 // Curiously, the abort does not occur if the -pedantic option is used.
11 // Cfront 2.0 passes this test.
13 // Keywords: abort, conditional operator?:, lvalues, composite types
15 struct struct0 {
16   int data_member;
18   virtual void function_member () {}    // contributes to the abort
21 struct0 object0;
22 struct0 object1;
23 struct0 object2;
25 int i;
27 void function0 ()
29   object2 = (i ? object0 : object1);            // OK
30   (i ? object0 : object1) = object2;            // causes abort
33 int main () { return 0; }