Commit 8496e135 by Jason Merrill

c++: Make PR92654 testcase valid.

parent 1e042b39
// PR c++/92654
// { dg-do compile { target c++17 } }
template <unsigned long> struct C;
struct A {
constexpr operator int () { return 42; }
};
template <int I> struct C {
static const bool ap = I;
};
template <auto I>
void am() {
[](auto an)
{
if constexpr (C<an>::ap) ; // { dg-error "constant" }
}(42);
if constexpr (C<an>::ap) ;
}(A{});
}
void fn() { am<42>(); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment