Message ID | 20190620122353.GD5989@redhat.com |
---|---|
State | New |
Headers | show |
Series | C++ PATCH to add test for c++/89873 | expand |
diff --git gcc/testsuite/g++.dg/cpp1y/noexcept1.C gcc/testsuite/g++.dg/cpp1y/noexcept1.C new file mode 100644 index 00000000000..86e46c96148 --- /dev/null +++ gcc/testsuite/g++.dg/cpp1y/noexcept1.C @@ -0,0 +1,13 @@ +// PR c++/89873 +// { dg-do compile { target c++14 } } + +template <int> bool b; + +template <typename> +struct C { + template <typename> friend int foo() noexcept(b<1>); // { dg-error "not usable in a constant expression|different exception specifier" } +}; + +template <typename> int foo() noexcept(b<1>); + +auto a = C<int>();