diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-02-16 17:48:08 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-02-16 17:48:08 +0000 |
commit | 205c0affcacc9b87200fe4ac066610a81263391c (patch) | |
tree | c9f38cf6cea74f1618390cb8a4b08f9934a45ad8 /gcc | |
parent | 4fb1c8f97a3e96bd00d819bd20d48dd2d1d5f112 (diff) | |
download | gcc-205c0affcacc9b87200fe4ac066610a81263391c.zip gcc-205c0affcacc9b87200fe4ac066610a81263391c.tar.gz gcc-205c0affcacc9b87200fe4ac066610a81263391c.tar.bz2 |
re PR c++/65080 (constexpr-ness lost by using alias in definition)
2015-02-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65080
* g++.dg/cpp0x/constexpr-65080.C: New.
From-SVN: r220739
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-65080.C | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c02263e..252865c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-16 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/65080 + * g++.dg/cpp0x/constexpr-65080.C: New. + 2015-02-16 Richard Biener <rguenther@suse.de> 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 0000000..d4b4948 --- /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 <typename T> +static constexpr T xxx(){ return T(); } + +template <typename T> +struct foo { + using type = T(*)(); + static constexpr type value[1] = {&xxx<T>}; +}; + +template <typename T> +constexpr typename foo<T>::type foo<T>::value[1]; + +int main() { + constexpr int x = foo<int>::value[0](); +} |