From f71f9d3fb6156edd82822ad9a26d3e4c6495d041 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 29 Aug 2014 15:58:26 +0000 Subject: [PATCH] re PR c++/54002 ([C++0x] Initializing constexpr static member using constexpr static method fails) 2014-08-29 Paolo Carlini PR c++/54002 * g++.dg/cpp0x/constexpr-54002.C: New. From-SVN: r214734 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-54002.C | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-54002.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d774a075c1..564b821f7c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-08-29 Paolo Carlini + + PR c++/54002 + * g++.dg/cpp0x/constexpr-54002.C: New. + 2014-08-29 Paolo Carlini 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 index 00000000000..125a18d8e9e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-54002.C @@ -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" } +}; -- 2.30.2