re PR c++/15938 (ICE with anonymous unions)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Thu, 21 Jul 2005 14:50:46 +0000 (14:50 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Thu, 21 Jul 2005 14:50:46 +0000 (14:50 +0000)
PR c++/15938
* g++.dg/init/union2.C: New test.

From-SVN: r102235

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/union2.C [new file with mode: 0644]

index faf36f7d8253ae04a34ffd514718c4553579c71d..e7fb312a08b74137cbd937c9e44c74574261f5dd 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/15938
+       * g++.dg/init/union2.C: New test.
+
 2005-07-21  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c/22393
diff --git a/gcc/testsuite/g++.dg/init/union2.C b/gcc/testsuite/g++.dg/init/union2.C
new file mode 100644 (file)
index 0000000..ac39f60
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/15938
+// { dg-do compile }
+// { dg-options "" }
+
+typedef union
+{
+  struct { int i; };
+  struct { char c; };
+} A;
+
+A a = { 0 };
+A b = {{ 0 }};
+A c = {{{ 0 }}};  // { dg-error "braces" }