Commit c28992a
authored
[Clang] Allow simpler visibility annotations when targeting win32 and mingw (#133699)
MinGW and Win32 disagree on where the `__declspec(dllexport)` should be
placed on extern template instantiations. However, there doesn't
fundamentally seem to be a problem with putting the annotation in both
places. This patch adds a new diagnostic group and `-Wattribute-ignored`
warnings about where the attribute is placed if the attribute is
different on the declaration and definition. There is another new
warning group `-Wdllexport-explicit-instantiation` that also diagnoses
places where the attribute is technically ignored, even though the
correct place is also annotated. This makes it possible to significantly
simplify libc++'s visibility annotations (see #133704).1 parent 60b5d06 commit c28992a
File tree
7 files changed
+66
-6
lines changed- clang
- include/clang/Basic
- lib/Sema
- test/SemaCXX
7 files changed
+66
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4397 | 4397 | | |
4398 | 4398 | | |
4399 | 4399 | | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
| 4407 | + | |
4400 | 4408 | | |
4401 | 4409 | | |
4402 | 4410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
549 | 552 | | |
550 | 553 | | |
551 | 554 | | |
| |||
990 | 993 | | |
991 | 994 | | |
992 | 995 | | |
993 | | - | |
| 996 | + | |
| 997 | + | |
994 | 998 | | |
995 | 999 | | |
996 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3904 | 3904 | | |
3905 | 3905 | | |
3906 | 3906 | | |
3907 | | - | |
| 3907 | + | |
3908 | 3908 | | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
3909 | 3917 | | |
| 3918 | + | |
| 3919 | + | |
3910 | 3920 | | |
3911 | 3921 | | |
3912 | 3922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6590 | 6590 | | |
6591 | 6591 | | |
6592 | 6592 | | |
6593 | | - | |
| 6593 | + | |
| 6594 | + | |
| 6595 | + | |
| 6596 | + | |
6594 | 6597 | | |
6595 | 6598 | | |
6596 | 6599 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10282 | 10282 | | |
10283 | 10283 | | |
10284 | 10284 | | |
10285 | | - | |
10286 | | - | |
| 10285 | + | |
| 10286 | + | |
| 10287 | + | |
| 10288 | + | |
| 10289 | + | |
| 10290 | + | |
| 10291 | + | |
10287 | 10292 | | |
10288 | 10293 | | |
10289 | 10294 | | |
10290 | 10295 | | |
10291 | 10296 | | |
| 10297 | + | |
| 10298 | + | |
| 10299 | + | |
| 10300 | + | |
| 10301 | + | |
| 10302 | + | |
| 10303 | + | |
| 10304 | + | |
| 10305 | + | |
| 10306 | + | |
| 10307 | + | |
10292 | 10308 | | |
10293 | 10309 | | |
10294 | 10310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
| |||
0 commit comments