summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr45330.C
blob: 02d9b3f63bb33bf45beb396f7ec81bfa32402f38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// { dg-do compile }
// Search std, __cxxabiv1, and global namespaces, plus one more.
// { dg-options "--param cxx-max-namespaces-for-diagnostic-help=4" }

#define NSPACE(NAME) namespace NAME { int foo; }

namespace A
{
  int foo;			// { dg-message "A::foo" "suggested alternative" }
}

namespace B
{
  int foo;
}

namespace C
{
  int foo;
}

namespace D
{
  int foo;
}

namespace E
{
  int foo;
}

int bar()
{
  return foo;			// { dg-error "was not declared" }
  // { dg-message "maximum limit of 4 namespaces" "maximum limit" { target *-*-* } 34 }
  // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 34 }
}