[Bug c++/123075] [16 Regression] ICE in get_keyed_decl_scope, at cp/module.cc:21808 since r16-4671

nshead at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 9 13:32:57 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123075

--- Comment #3 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
Reduced:

  export module M;
  template <typename T> concept r = []{ return true; }();
  template <typename T> inline void foo() { r<T>; }
  template void foo<int>();

The instantiation of the concept for some reason is attaching the lambda to the
function decl, which we're not prepared to handle.  We previously just treated
this as an unmergeable entity, which I don't think is correct (we should be
able to merge this, but it needs to be keyed to the concept not just wherever
it's instantiated).


More information about the Gcc-bugs mailing list