Commit 80bd9eb
committed
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>1 parent 4c01f40 commit 80bd9eb
File tree
4 files changed
+37
-12
lines changed- gcc
- cp
- testsuite/g++.dg/modules
4 files changed
+37
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11014 | 11014 | | |
11015 | 11015 | | |
11016 | 11016 | | |
11017 | | - | |
11018 | | - | |
11019 | | - | |
11020 | | - | |
11021 | | - | |
11022 | | - | |
11023 | | - | |
11024 | | - | |
11025 | | - | |
11026 | | - | |
11027 | | - | |
11028 | | - | |
| 11017 | + | |
| 11018 | + | |
| 11019 | + | |
| 11020 | + | |
| 11021 | + | |
| 11022 | + | |
| 11023 | + | |
| 11024 | + | |
| 11025 | + | |
| 11026 | + | |
| 11027 | + | |
| 11028 | + | |
| 11029 | + | |
| 11030 | + | |
| 11031 | + | |
| 11032 | + | |
| 11033 | + | |
11029 | 11034 | | |
11030 | 11035 | | |
11031 | 11036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments