From 205c0affcacc9b87200fe4ac066610a81263391c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 16 Feb 2015 17:48:08 +0000 Subject: [PATCH] re PR c++/65080 (constexpr-ness lost by using alias in definition) 2015-02-16 Paolo Carlini PR c++/65080 * g++.dg/cpp0x/constexpr-65080.C: New. From-SVN: r220739 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c02263ea5cc..252865c20e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-16 Paolo Carlini + + PR c++/65080 + * g++.dg/cpp0x/constexpr-65080.C: New. + 2015-02-16 Richard Biener PR tree-optimization/63593 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C new file mode 100644 index 00000000000..d4b49482bbb --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C @@ -0,0 +1,18 @@ +// PR c++/65080 +// { dg-do compile { target c++11 } } + +template +static constexpr T xxx(){ return T(); } + +template +struct foo { + using type = T(*)(); + static constexpr type value[1] = {&xxx}; +}; + +template +constexpr typename foo::type foo::value[1]; + +int main() { + constexpr int x = foo::value[0](); +} -- 2.30.2