https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123290
--- Comment #2 from Alfred Agrell <blubban at gmail dot com> --- Testcase reduction complete, the non-const lvalue reference things disappeared during reduction (there's probably an accepts-invalid or rejects-valid nearby as well) https://godbolt.org/z/v5zM1E8se template<typename T> class identity { public: using type = T; }; template <auto kLambda> class FlatMapHelper {}; template <int=1> auto Adapter() { using OutputType = FlatMapHelper<[]<int>(){}>; []<int=0>() { using T = identity<OutputType>::type; }(); } int main() { Adapter(); }
