re PR c++/54002 ([C++0x] Initializing constexpr static member using constexpr static...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 29 Aug 2014 15:58:26 +0000 (15:58 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 29 Aug 2014 15:58:26 +0000 (15:58 +0000)
2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54002
* g++.dg/cpp0x/constexpr-54002.C: New.

From-SVN: r214734

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

index 3d774a075c14d32cb4b32ae30407a673c9135056..564b821f7c5e5e23959c3a99efc8e82b7bf83fa6 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54002
+       * g++.dg/cpp0x/constexpr-54002.C: New.
+
 2014-08-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/56991
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-54002.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-54002.C
new file mode 100644 (file)
index 0000000..125a18d
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/54002
+// { dg-do compile { target c++11 } }
+
+class C1 {
+  constexpr static int foo(int x) { return x + 1; }
+  constexpr static int bar = foo(sizeof(int)); // { dg-error "constant expression" }
+};