diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C new file mode 100644 index 00000000000..8003ed9e133 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-specialization.C @@ -0,0 +1,12 @@ +// PR c++/56871 +// { dg-options "-std=c++11" } + +template<typename T> constexpr int foo(T); +template<> int foo(int); +template<> int foo(int); // { dg-error "previous" } +template<> constexpr int foo(int); // { dg-error "redeclaration" } + +template<typename T> int bar(T); +template<> constexpr int bar(int); +template<> constexpr int bar(int); // { dg-error "previous" } +template<> int bar(int); // { dg-error "redeclaration" } |