summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr45330.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/pr45330.C')
-rw-r--r--gcc/testsuite/g++.dg/pr45330.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/pr45330.C b/gcc/testsuite/g++.dg/pr45330.C
new file mode 100644
index 000000000..02d9b3f63
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr45330.C
@@ -0,0 +1,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 }
+}