From f185af3614d9328d0e1808638d050a0c101e4dd8 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 6 Jun 2014 09:52:33 +0000 Subject: [PATCH] re PR c++/60199 ('error: field initializer is not constant' when initializing static member function pointer to a function) 2014-06-06 Paolo Carlini PR c++/60199 * g++.dg/cpp0x/constexpr-60199.C: New. From-SVN: r211310 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-60199.C | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-60199.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f9f03d90c08..a29070b5be5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-06-06 Paolo Carlini + + PR c++/60199 + * g++.dg/cpp0x/constexpr-60199.C: New. + 2014-06-06 Thomas Preud'homme * gcc.dg/optimize-bswaphi-1.c: Adapt test to change of dump output. diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-60199.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-60199.C new file mode 100644 index 00000000000..20dd946c4c7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-60199.C @@ -0,0 +1,11 @@ +// PR c++/60199 +// { dg-do compile { target c++11 } } + +void f() {} + +static constexpr void (*g1)() = &f; +static constexpr void (*g2)() = f; +struct S { + static constexpr void (*g3)() = &f; + static constexpr void (*g4)() = f; +}; -- 2.30.2