]> granicus.if.org Git - clang/commitdiff
Add test case for PR 3675.
authorTed Kremenek <kremenek@apple.com>
Fri, 27 Feb 2009 16:48:08 +0000 (16:48 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 27 Feb 2009 16:48:08 +0000 (16:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65635 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/PR3675.c [new file with mode: 0644]

diff --git a/test/Sema/PR3675.c b/test/Sema/PR3675.c
new file mode 100644 (file)
index 0000000..9c86d8c
--- /dev/null
@@ -0,0 +1,16 @@
+// RUN: clang -verify %s
+//
+// This example was reduced from actual code in Wine 1.1.13.  GCC accepts this
+// code, while the correct behavior is to reject it.
+//
+
+typedef struct _IRP {
+  union {
+    struct {
+      union {} u; // expected-note{{previous declaration is here}}
+      struct {
+        union {} u; // expected-error{{error: member of anonymous struct redeclares 'u'}}
+      };
+    } Overlay;
+  } Tail;
+} IRP;