| 1 |
// { dg-do assemble } |
| 2 |
// GROUPS passed constructors |
| 3 |
// ctor file |
| 4 |
// From: [email protected] |
| 5 |
// Date: Tue, 5 Oct 1993 19:31:16 +0200 |
| 6 |
// Message-Id: <[email protected]> |
| 7 |
// Subject: Nested class constructor calling bug |
| 8 |
|
| 9 |
class X |
| 10 |
{ |
| 11 |
public: |
| 12 |
class Y |
| 13 |
{ |
| 14 |
public: |
| 15 |
Y(int i) : a(i) {} |
| 16 |
int a; |
| 17 |
}; |
| 18 |
static void f(Y y); |
| 19 |
}; |
| 20 |
|
| 21 |
void X::f(X::Y y) |
| 22 |
{ |
| 23 |
} |
| 24 |
|
| 25 |
int |
| 26 |
main() |
| 27 |
{ |
| 28 |
X::Y y = X::Y(1); // Tries to call ctor Y instead of X::Y |
| 29 |
X::f(X::Y(2)); // Tries to call Y instead of X::Y |
| 30 |
|
| 31 |
return 0; |
| 32 |
} |
| 33 |
|