Commit 9670e09
authored
Enable unique-object-duplication warning for windows (#143537)
Followup to #125526. This expands the logic of the
unique-object-duplication warning so that it also works for windows
code.
For the most part, the logic is unchanged, merely substituting "has no
import/export annotation" in place of "has hidden visibility". However,
there are some small inconsistencies between the two; namely, visibility
is propagated through nested classes, while import/export annotations
aren't.
This PR:
1. Updates the logic for the warning to account for the differences
between posix and windows
2. Changes the warning message and documentation appropriately
3. Updates the tests to cover windows, and adds new test cases for the
places where behavior differs.
This PR was tested by building chromium (cross compiling linux->windows)
with the changes in place. After accounting for the differences in
semantics, no new warnings were discovered.1 parent 82911f1 commit 9670e09
File tree
5 files changed
+114
-54
lines changed- clang
- include/clang/Basic
- lib/Sema
- test/SemaCXX
5 files changed
+114
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
806 | 806 | | |
807 | 807 | | |
808 | 808 | | |
809 | | - | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
810 | 812 | | |
811 | 813 | | |
812 | 814 | | |
| |||
815 | 817 | | |
816 | 818 | | |
817 | 819 | | |
818 | | - | |
| 820 | + | |
819 | 821 | | |
820 | 822 | | |
821 | 823 | | |
| |||
825 | 827 | | |
826 | 828 | | |
827 | 829 | | |
828 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
829 | 836 | | |
830 | 837 | | |
831 | 838 | | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | 839 | | |
836 | 840 | | |
837 | 841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6267 | 6267 | | |
6268 | 6268 | | |
6269 | 6269 | | |
6270 | | - | |
6271 | | - | |
6272 | | - | |
6273 | | - | |
6274 | | - | |
6275 | | - | |
6276 | | - | |
6277 | | - | |
| 6270 | + | |
| 6271 | + | |
| 6272 | + | |
| 6273 | + | |
| 6274 | + | |
| 6275 | + | |
| 6276 | + | |
| 6277 | + | |
| 6278 | + | |
| 6279 | + | |
| 6280 | + | |
| 6281 | + | |
| 6282 | + | |
6278 | 6283 | | |
6279 | 6284 | | |
6280 | 6285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13518 | 13518 | | |
13519 | 13519 | | |
13520 | 13520 | | |
13521 | | - | |
| 13521 | + | |
| 13522 | + | |
| 13523 | + | |
| 13524 | + | |
| 13525 | + | |
| 13526 | + | |
| 13527 | + | |
| 13528 | + | |
| 13529 | + | |
| 13530 | + | |
| 13531 | + | |
| 13532 | + | |
| 13533 | + | |
| 13534 | + | |
| 13535 | + | |
| 13536 | + | |
| 13537 | + | |
| 13538 | + | |
| 13539 | + | |
| 13540 | + | |
13522 | 13541 | | |
| 13542 | + | |
13523 | 13543 | | |
13524 | 13544 | | |
13525 | 13545 | | |
| |||
13550 | 13570 | | |
13551 | 13571 | | |
13552 | 13572 | | |
13553 | | - | |
13554 | | - | |
13555 | 13573 | | |
13556 | 13574 | | |
13557 | 13575 | | |
13558 | | - | |
13559 | | - | |
| 13576 | + | |
13560 | 13577 | | |
13561 | 13578 | | |
13562 | 13579 | | |
13563 | 13580 | | |
13564 | 13581 | | |
13565 | | - | |
| 13582 | + | |
13566 | 13583 | | |
13567 | 13584 | | |
13568 | 13585 | | |
| |||
13575 | 13592 | | |
13576 | 13593 | | |
13577 | 13594 | | |
13578 | | - | |
| 13595 | + | |
13579 | 13596 | | |
13580 | 13597 | | |
13581 | 13598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
0 commit comments