re PR c++/67625 (some constexpr expressions rejected as enumerator value)
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:11:47 +0000 (22:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:11:47 +0000 (22:11 +0200)
2017-10-10  Jakub Jelinek  <jakub@redhat.com>

PR c++/67625
* g++.dg/cpp0x/pr67625.C: New test.

From-SVN: r253617

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

index 3dcc261d131c93b8a35ef524c5bf3305e0371b67..9942f4b91e02d58f3b6c20d868f4db077c63112a 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       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 (file)
index 0000000..bcff5af
--- /dev/null
@@ -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) };