c++: Make PR92654 testcase valid.
This commit is contained in:
parent
1e042b396e
commit
8496e135b1
@ -1,12 +1,17 @@
|
||||
// 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>(); }
|
||||
|
Loading…
Reference in New Issue
Block a user