| 1 |
// { dg-do assemble } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } |
| 3 |
// GROUPS passed nest |
| 4 |
#include <iostream> |
| 5 |
|
| 6 |
struct inner { |
| 7 |
static void f() { std::cout << "inner::f()\n";} |
| 8 |
}; |
| 9 |
|
| 10 |
struct outer { |
| 11 |
|
| 12 |
struct inner { |
| 13 |
static void f() { std::cout << "outer::inner::f()\n";} |
| 14 |
}; |
| 15 |
|
| 16 |
static void f() { |
| 17 |
inner::f(); //call of outer::inner::f() |
| 18 |
::inner::f(); //(try to) call inner::f() => parse error |
| 19 |
} |
| 20 |
}; |
| 21 |
|
| 22 |
int main() { |
| 23 |
outer::f(); |
| 24 |
std::cout << std::endl; |
| 25 |
return 0; |
| 26 |
} |