| 1 |
// { dg-do run } |
| 2 |
// g++ 1.37.1 bug 900331_02 |
| 3 |
|
| 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. |
| 7 |
|
| 8 |
// Cfront 2.0 passes this test. |
| 9 |
|
| 10 |
// keywords: conditional operator?:, lvalues, composite types |
| 11 |
|
| 12 |
struct struct0 { |
| 13 |
int data_member; |
| 14 |
}; |
| 15 |
|
| 16 |
struct0 object0; |
| 17 |
struct0 object1; |
| 18 |
struct0 object2; |
| 19 |
|
| 20 |
int i; |
| 21 |
|
| 22 |
void function0 () |
| 23 |
{ |
| 24 |
(i ? object0 : object1).data_member = 99; // { dg-bogus "" } |
| 25 |
(i ? object0 : object1) = object2; // { dg-bogus "" } |
| 26 |
} |
| 27 |
|
| 28 |
int main () { return 0; } |