| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
|
| 3 |
struct A |
| 4 |
{ |
| 5 |
constexpr operator bool () { return true; } |
| 6 |
int i; |
| 7 |
}; |
| 8 |
|
| 9 |
A a; |
| 10 |
|
| 11 |
template <class T> void f() |
| 12 |
{ |
| 13 |
constexpr bool b = a; |
| 14 |
if constexpr (a) { } |
| 15 |
} |
| 16 |
|
| 17 |
int main() |
| 18 |
{ |
| 19 |
f<int>(); |
| 20 |
} |