summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wcxx-compat-21.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-06 00:07:50 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-06 00:07:50 +0000
commit567123633cde83d84b94e0051ac8668c03a33104 (patch)
treea6ebd61fe15b0d819dbd87fef8138e1bb10989e0 /gcc/testsuite/gcc.dg/Wcxx-compat-21.c
parent70c912cff7f00414cad5c3dee2ab969f7f4acf08 (diff)
downloadgcc-567123633cde83d84b94e0051ac8668c03a33104.tar.gz
PR c/44772
* c-decl.c (warn_cxx_compat_finish_struct): Don't call pointer_set_contains if DECL_NAME is NULL. * gcc.dg/Wcxx-compat-21.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166384 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-21.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-21.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-21.c b/gcc/testsuite/gcc.dg/Wcxx-compat-21.c
new file mode 100644
index 00000000000..183f0f17980
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-21.c
@@ -0,0 +1,25 @@
+/* PR c/44772 */
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+typedef enum { E1, E2 } E;
+
+typedef struct
+{
+ E e;
+ union
+ {
+ int i;
+ char *c;
+ }; /* { dg-bogus "as both field and typedef name" } */
+} S;
+
+S s;
+
+typedef int T;
+
+struct U
+{
+ T t;
+ union { int i; }; /* { dg-bogus "as both field and typedef name" } */
+};