https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107437
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Reduced version of the original testcase:
struct integral_constant {
constexpr operator int() const { return 42; }
};
template<int N>
struct A {
static constexpr int value = N;
};
template<class T>
struct B {
static constexpr int value = T::value;
};
template<class T>
void f(T t) {
using alias = A<t>;
[](auto) {
B<alias> a; // { dg-bogus "'t' is not captured" }
return a.value;
}(0);
}
template void f(integral_constant);