| 1 |
// { dg-do assemble } |
| 2 |
// g++ 1.36.1 bug 900213_01 |
| 3 |
|
| 4 |
// g++ incorrectly diagnoses the error when an attempt is made to reference |
| 5 |
// a non-static data-member without an object indication. |
| 6 |
|
| 7 |
// Similar attempts to reference non-static function-members are correctly |
| 8 |
// diagnosed by g++. |
| 9 |
|
| 10 |
// Cfront 2.0 passes this test. |
| 11 |
|
| 12 |
// keywords: non-static members, member pointers, scope resolution |
| 13 |
|
| 14 |
struct struct0 { |
| 15 |
int struct0_data_member_0; /* { dg-message "" } gets error from below */ |
| 16 |
int struct0_function_member_0 (); |
| 17 |
}; |
| 18 |
|
| 19 |
int i; |
| 20 |
|
| 21 |
void global_function_0 () |
| 22 |
{ |
| 23 |
i = struct0::struct0_data_member_0; /* { dg-error "" } mishandled by g++ */ |
| 24 |
//i = struct0::struct0_function_member_0 (); /* gets caught by g++ */ |
| 25 |
} |
| 26 |
|
| 27 |
int main () { return 0; } |