Files
gcc-reflection/gcc/testsuite/g++.dg/modules/lambda-8.h
Nathaniel Shead 80bd9eb481 c++/modules: Treat unattached lambdas as TU-local [PR116568]
This fixes ICEs where unattached lambdas at class scope (for instance,
in member template instantiations) are streamed.  This is only possible
in header units, as in named modules attempting to stream such lambdas
will be an error.

	PR c++/116568

gcc/cp/ChangeLog:

	* module.cc (trees_out::get_merge_kind): Treat all lambdas
	without a mangling scope as un-mergeable.

gcc/testsuite/ChangeLog:

	* g++.dg/modules/lambda-8.h: New test.
	* g++.dg/modules/lambda-8_a.H: New test.
	* g++.dg/modules/lambda-8_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
2025-01-25 11:36:10 +11:00

9 lines
195 B
C++

// PR c++/116568
template <typename> struct S {
template <typename> using t = decltype([]{});
};
// 't' does not currently have a mangling scope, but should not ICE
using t = S<int>::t<int>;