gcc/testsuite/g++.dg/cpp0x/noexcept39.C
raw| 1 | // PR c++/89612 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename T> |
| 5 | struct C { |
| 6 | template <int N> |
| 7 | friend void foo(T t) noexcept(sizeof(decltype(t)) > 1); |
| 8 | |
| 9 | template <int N> |
| 10 | friend void foo2(T t) noexcept(sizeof(decltype(t)) < 1); // { dg-error "different exception" } |
| 11 | }; |
| 12 | |
| 13 | template <int N> |
| 14 | void foo(int i) noexcept { } |
| 15 | |
| 16 | template <int N> |
| 17 | void foo2(int i) noexcept { } |
| 18 | |
| 19 | C<int> c; |