Commit b3078fa
committed
[clang] Do not emit template parameter objects as COMDATs when they have internal linkage.
Per the ELF spec, section groups may only contain local symbols if those symbols are only
referenced from within the section group. [1] In the case of template parameter objects,
they can be referenced from outside the group when the type of the object was declared
in an anonymous namespace. In that case, we can't place the object in a COMDAT. This matches
GCC's linkage behavior on the test input.
[1]: https://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_groups1 parent 2c030a1 commit b3078fa
File tree
2 files changed
+14
-1
lines changed- clang
- lib/CodeGen
- test/CodeGenCXX
2 files changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3765 | 3765 | | |
3766 | 3766 | | |
3767 | 3767 | | |
3768 | | - | |
| 3768 | + | |
3769 | 3769 | | |
3770 | 3770 | | |
3771 | 3771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments