From: Marek Polacek Date: Tue, 21 May 2019 21:25:23 +0000 (+0000) Subject: DR 1940 - static_assert in anonymous unions. X-Git-Tag: misc/cutover-git~5342 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5007f60b33a58edbcba399b7e5083553bf604faf;p=thirdparty%2Fgcc.git DR 1940 - static_assert in anonymous unions. * g++.dg/DRs/dr1940.C: New test. From-SVN: r271482 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2781fa0f0bf..2a4cd7fe4714 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-05-21 Marek Polacek + + DR 1940 - static_assert in anonymous unions. + * g++.dg/DRs/dr1940.C: New test. + 2019-05-21 Uroš Bizjak 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 index 000000000000..dee4ae998a6a --- /dev/null +++ b/gcc/testsuite/g++.dg/DRs/dr1940.C @@ -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; +}