mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
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>
9 lines
195 B
C++
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>;
|