diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f576273d9c1b..98f8733110b3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-03-09 Paolo Carlini + + PR c++/71966 + * g++.dg/cpp0x/pr71966-1.C: New. + * g++.dg/cpp0x/pr71966-2.C: Likewise. + 2017-03-09 Martin Liska PR tree-optimization/79631 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71966-1.C b/gcc/testsuite/g++.dg/cpp0x/pr71966-1.C new file mode 100644 index 000000000000..76327201382f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr71966-1.C @@ -0,0 +1,13 @@ +// PR c++/71966 +// { dg-do compile { target c++11 } } + +struct A +{ + constexpr A (int); // { dg-message "never defined" } + constexpr operator int () const { return 0; } +}; + +template < int > struct B {}; + +constexpr A a = 0; // { dg-error "before its definition" } +B < a > b; diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71966-2.C b/gcc/testsuite/g++.dg/cpp0x/pr71966-2.C new file mode 100644 index 000000000000..aedd4cea7f3b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr71966-2.C @@ -0,0 +1,15 @@ +// PR c++/71966 +// { dg-do compile { target c++11 } } + +struct A +{ + constexpr A (int); // { dg-message "never defined" } + constexpr operator int () const { return 0; } + int c; +}; + +template +struct B {}; + +constexpr A a = 0; // { dg-error "before its definition" } +B b;