OSDN Git Service

In gcc/objc/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / pr45330.C
1 // { dg-do compile }
2 // Search std, __cxxabiv1, and global namespaces, plus one more.
3 // { dg-options "--param cxx-max-namespaces-for-diagnostic-help=4" }
4
5 #define NSPACE(NAME) namespace NAME { int foo; }
6
7 namespace A
8 {
9   int foo;                      // { dg-message "A::foo" "suggested alternative" }
10 }
11
12 namespace B
13 {
14   int foo;
15 }
16
17 namespace C
18 {
19   int foo;
20 }
21
22 namespace D
23 {
24   int foo;
25 }
26
27 namespace E
28 {
29   int foo;
30 }
31
32 int bar()
33 {
34   return foo;                   // { dg-error "was not declared" }
35   // { dg-message "maximum limit of 4 namespaces" "maximum limit" { target *-*-* } 34 }
36   // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 34 }
37 }