| 1 |
// PR c++/78244 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template <typename T> |
| 5 |
auto f1() -> decltype(int{2.0}, void()) { } // { dg-error "narrowing conversion" } |
| 6 |
|
| 7 |
template <typename T> |
| 8 |
auto f2() -> decltype(int{2.0}) { return 1; } // { dg-error "narrowing conversion" } |
| 9 |
|
| 10 |
template <typename T> |
| 11 |
auto f3() -> decltype(void(), int{2.0}) { return 1; } // { dg-error "narrowing conversion" } |
| 12 |
|
| 13 |
template <typename T> |
| 14 |
auto f4() -> decltype((int{2.0})) { return 1; } // { dg-error "narrowing conversion" } |