https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122494

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |16.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2025-10-30
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Here is a version which is definitely in a complete class context
which is still failing:
```
template <typename Ts>
struct L {};

template <typename T>
struct S;

template <typename T>
concept C = false;

struct A {};
static_assert(!C<A>);

template <typename T> requires (!C<T>)
struct S<T> {
    constexpr static unsigned v = 0;
};

template <typename T>
struct S<L<T>> {
    // unsigned int or long or long long
    constexpr static unsigned v = S<T>::v;
    // generic lambda
    constexpr static bool f();
};
// if we change this to 1, it works.
#if 0
static_assert(
[](auto) {
        if (S<L<A>>::v == 0) {}
        return true;
    }(1));
#endif
template <typename T>
constexpr  bool S<L<T>>::f() {
    return [](auto) {
        // "v == 0"
        if (v == 0) {}
        return true;
    }(1);
}
static_assert(S<L<A>>::f());
int main() {}


```

Reply via email to