Commit 8496e135 by Jason Merrill

c++: Make PR92654 testcase valid.

parent 1e042b39
// PR c++/92654 // PR c++/92654
// { dg-do compile { target c++17 } } // { 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> template <auto I>
void am() { void am() {
[](auto an) [](auto an)
{ {
if constexpr (C<an>::ap) ; // { dg-error "constant" } if constexpr (C<an>::ap) ;
}(42); }(A{});
} }
void fn() { am<42>(); } 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