summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr45330.C
blob: f16094d93f1f724580f4ebc0aec913c9b61685f5 (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
38
39
40
41
42
43
44
45
46
// { dg-do compile { target c++11 } }
// Search std, __cxxabiv1, and global namespaces, plus two more,
// breadth first

// { dg-options "--param cxx-max-namespaces-for-diagnostic-help=5" }

// ::, std and __cxxabiv1

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

namespace B
{
  inline namespace I
  {
    int foo;			// { dg-message "B::I::foo" "suggested alternative" }
  }
}

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 5 namespaces" "maximum limit" { target *-*-* } .-1 }
  // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } .-2 }
}