gcc/testsuite/g++.dg/cpp1y/noexcept1.C
raw| 1 | // PR c++/89873 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | template <int> bool b; |
| 5 | |
| 6 | template <typename> |
| 7 | struct C { |
| 8 | template <typename> friend int foo() noexcept(b<1>); // { dg-error "not usable in a constant expression" } |
| 9 | }; |
| 10 | |
| 11 | template <typename> int foo() noexcept(b<1>); // { dg-error "not usable in a constant expression" } |
| 12 | |
| 13 | auto a = C<int>(); |