| 1 |
// { dg-do assemble } |
| 2 |
// g++ 1.36.1 bug 900205_02 |
| 3 |
|
| 4 |
// g++ allows constructors to be defined which do not include |
| 5 |
// initializations for reference members of their associated classes. |
| 6 |
|
| 7 |
// Cfront 2.0 does not allow this. |
| 8 |
|
| 9 |
// keywords: reference members, constructors, member initialization |
| 10 |
|
| 11 |
int i; |
| 12 |
|
| 13 |
class c0 { |
| 14 |
int &int_ref; |
| 15 |
public: |
| 16 |
c0 () /* : int_ref(i) */ { // { dg-error "" } reference needs initializer |
| 17 |
} |
| 18 |
}; |
| 19 |
|
| 20 |
class c1 { |
| 21 |
int &int_ref; |
| 22 |
public: |
| 23 |
c1 (); |
| 24 |
}; |
| 25 |
|
| 26 |
c1::c1() /* : int_ref(i) */ { // { dg-error "" } reference needs initializer |
| 27 |
} |
| 28 |
|
| 29 |
int main () { return 0; } |