diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-05-24 15:12:37 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-24 15:12:37 +0000 |
commit | a5dedb5e59b72167bcc501f28a8a8c08b9465070 (patch) | |
tree | 6d7f10839569b16ec8673638bf60ae8157f951da | |
parent | 73fb763006daf89ee7c8f143848f598ef1d891bc (diff) | |
download | gcc-a5dedb5e59b72167bcc501f28a8a8c08b9465070.zip gcc-a5dedb5e59b72167bcc501f28a8a8c08b9465070.tar.gz gcc-a5dedb5e59b72167bcc501f28a8a8c08b9465070.tar.bz2 |
re PR c++/53464 (Invalid default value for non-type template parameter is accepted)
2012-05-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53464
* g++.dg/cpp0x/constexpr-default1.C: New.
From-SVN: r187842
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-default1.C | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c00557e..065b5a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2012-05-24 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/53464 + * g++.dg/cpp0x/constexpr-default1.C: New. + +2012-05-24 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/32080 * g++.dg/eh/goto2.C: New. diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-default1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-default1.C new file mode 100644 index 0000000..68d50b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-default1.C @@ -0,0 +1,22 @@ +// PR c++/53464 +// { dg-do compile { target c++11 } } + +template <int value> +struct bar +{ + static constexpr int get() + { + return value; + } +}; + +template <typename A, int value = A::get()> +struct foo +{ +}; + +int main() +{ + typedef foo<bar<0>> type; + return 0; +} |