https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103923
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- Maybe we don't actually need to do anything here. As the original testcase shows, trying to actually use the map is still ill-formed: //T().m[T::K()]; // for extra fun I'm not going to work on this for now, because the code is undefined, it's just that we don't give a clear diagnostic about what the problem is. There's a simple workaround, which is to not use the 'auto' return type.