summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/anon2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/anon2.C')
-rw-r--r--gcc/testsuite/g++.dg/lookup/anon2.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/anon2.C b/gcc/testsuite/g++.dg/lookup/anon2.C
new file mode 100644
index 000000000..d556ba003
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/anon2.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+// { dg-options "" }
+
+// Make sure we issue a diagnostic if a type with no linkage is used
+// to declare a a variable that has linkage.
+
+struct { int i; } a; // { dg-warning "anonymous type" }
+
+void foo() { a.i; }