]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
DR 1940 - static_assert in anonymous unions.
authorMarek Polacek <polacek@redhat.com>
Tue, 21 May 2019 21:25:23 +0000 (21:25 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 21 May 2019 21:25:23 +0000 (21:25 +0000)
* g++.dg/DRs/dr1940.C: New test.

From-SVN: r271482

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

index b2781fa0f0bf55e62f1cb7ec1c0fc3806d4bd943..2a4cd7fe4714e0f69608372a050b053969253ad0 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-21  Marek Polacek  <polacek@redhat.com>
+
+       DR 1940 - static_assert in anonymous unions.
+       * g++.dg/DRs/dr1940.C: New test.
+
 2019-05-21  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR target/90547
diff --git a/gcc/testsuite/g++.dg/DRs/dr1940.C b/gcc/testsuite/g++.dg/DRs/dr1940.C
new file mode 100644 (file)
index 0000000..dee4ae9
--- /dev/null
@@ -0,0 +1,13 @@
+// DR 1940 - static_assert in anonymous unions
+// { dg-do compile { target c++11 } }
+
+namespace N {
+  static union { int i; static_assert(1, ""); };
+}
+
+void
+g ()
+{
+  union { int j; static_assert(1, ""); };
+  N::i = 42;
+}