https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99152
Bug ID: 99152 Summary: Wrong type of implicitly captured by-value unevaluated operand Product: gcc Version: 11.0 URL: https://godbolt.org/z/sYsTqa Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: oleksandr.koval.dev at gmail dot com Target Milestone: --- This example was taken directly from the standard(http://eel.is/c++draft/expr.prim.id.unqual#3): void f() { float x, &r = x; auto l = [=] () { static_assert(std::is_same_v<decltype(x), float>); static_assert(std::is_same_v<decltype((x)), const float&>); static_assert(std::is_same_v<decltype(r), float&>); // fails, decltype((r)) is float& static_assert(std::is_same_v<decltype((r)), const float&>); }; }