summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wcxx-compat-16.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-19 15:25:16 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-19 15:25:16 +0000
commit4a76ab2acb9e11d7a0fbb6ac702b781f73418a46 (patch)
treefc52468ac72e4ed7eef097489864a842fdb17db4 /gcc/testsuite/gcc.dg/Wcxx-compat-16.c
parent1f853dda7bab04eb6ef0d741b7cbb0f7e0c276b0 (diff)
downloadgcc-4a76ab2acb9e11d7a0fbb6ac702b781f73418a46.tar.gz
./:
* c-decl.c (grokdeclarator): If -Wc++-compat, warn about a global variable with an anonymous type. fortran/: * cpp.c (struct gfc_cpp_option_data): Give this struct, used for the global variable gfc_cpp_option, a name. testsuite/: * gcc.dg/Wcxx-compat-16.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148708 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-16.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-16.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-16.c b/gcc/testsuite/gcc.dg/Wcxx-compat-16.c
new file mode 100644
index 00000000000..51b503bf607
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-16.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+struct { int f1; } g1; /* { dg-warning "C\[+\]\[+\]" } */
+static struct { int f2; } g2;
+struct s { int f3; } g3;
+union { int f4; } g4; /* { dg-warning "C\[+\]\[+\]" } */
+static union { int f5; } g5;
+union u { int f6; } g6;
+enum { A } g7; /* { dg-warning "C\[+\]\[+\]" } */
+static enum { B } g8;
+enum E { C } g9;