From: Jakub Jelinek Date: Tue, 10 Oct 2017 20:11:47 +0000 (+0200) Subject: re PR c++/67625 (some constexpr expressions rejected as enumerator value) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2ca2504f01d2805fd9308bf112912fc8a8a2bad;p=gcc.git re PR c++/67625 (some constexpr expressions rejected as enumerator value) 2017-10-10 Jakub Jelinek PR c++/67625 * g++.dg/cpp0x/pr67625.C: New test. From-SVN: r253617 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3dcc261d131..9942f4b91e0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-10-10 Jakub Jelinek + PR c++/67625 + * g++.dg/cpp0x/pr67625.C: New test. + PR middle-end/70887 * g++.dg/cpp0x/pr70887.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr67625.C b/gcc/testsuite/g++.dg/cpp0x/pr67625.C new file mode 100644 index 00000000000..bcff5af5831 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr67625.C @@ -0,0 +1,12 @@ +// PR c++/67625 +// { dg-do compile { target c++11 } } + +constexpr unsigned short +bswap16 (unsigned short x) +{ + return __builtin_bswap16 (x); +} +constexpr int a = bswap16 (1); +enum { b = a }; +enum { c = __builtin_bswap16 (1) }; +enum { d = bswap16 (1) };