From: Paolo Carlini Date: Mon, 16 Feb 2015 17:48:08 +0000 (+0000) Subject: re PR c++/65080 (constexpr-ness lost by using alias in definition) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=205c0affcacc9b87200fe4ac066610a81263391c;p=gcc.git 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 --- 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](); +}