| 1 | // { dg-do compile { target c++14 } } |
| 2 | |
| 3 | // PR c++/111357 - __integer_pack fails to work with values of dependent type |
| 4 | // convertible to integers in noexcept context |
| 5 | |
| 6 | #include <utility> |
| 7 | |
| 8 | using std::integer_sequence; |
| 9 | using std::make_integer_sequence; |
| 10 | |
| 11 | template<int... V> |
| 12 | void g(integer_sequence<int,V...>) |
| 13 | {} |
| 14 | |
| 15 | template<typename ...T> |
| 16 | struct c1 |
| 17 | { |
| 18 | static constexpr int value = 1; |
| 19 | constexpr operator int() { return value; } |
| 20 | }; |
| 21 | |
| 22 | template<typename T> |
| 23 | struct R |
| 24 | { |
| 25 | using S = make_integer_sequence<int,c1<T>{}>; |
| 26 | |
| 27 | R() noexcept(noexcept(g(S()))) // { dg-bogus "argument to .__integer_pack." } |
| 28 | {} |
| 29 | }; |
| 30 | |
| 31 | int main() |
| 32 | { |
| 33 | R<int>(); |
| 34 | } |