https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116439
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> --- (In reply to Patrick Palka from comment #4) > It's correct but certainly weird that the current rules mean the second to > last decltype(auto) is invalid, because decltype(source) is S& but the > closure member is const S&.. D'oh, ignore this, I totally misinterpreted the testcase. The weird example I had in mind was https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655632.html FWIW