From 4a76ab2acb9e11d7a0fbb6ac702b781f73418a46 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 19 Jun 2009 15:25:16 +0000 Subject: ./: * 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 --- gcc/testsuite/gcc.dg/Wcxx-compat-16.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/Wcxx-compat-16.c (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-16.c') 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; -- cgit v1.2.1