Commit 118f0c1
committed
[Sema] Fix false positive warnings for misaligned member access
Potential misaligned accesses are collected and reported on a per full
expression basis, however some of them are discarded before reporting.
When a nested full expression is completed it will emit diagnostics for
all potential misaligned accesses collected up to that point. That
includes candidates that were found in the parent expression, even
though they might have gotten discarded later.
This is fixed by maintaining separate potential candidate lists per
expression evaluation context and processing only the list for the
current context.1 parent 28e1e7e commit 118f0c1
File tree
4 files changed
+24
-10
lines changed- clang
- include/clang/Sema
- lib/Sema
- test/Sema
4 files changed
+24
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3110 | 3110 | | |
3111 | 3111 | | |
3112 | 3112 | | |
3113 | | - | |
3114 | | - | |
3115 | | - | |
3116 | 3113 | | |
3117 | 3114 | | |
3118 | 3115 | | |
| |||
6765 | 6762 | | |
6766 | 6763 | | |
6767 | 6764 | | |
| 6765 | + | |
| 6766 | + | |
| 6767 | + | |
| 6768 | + | |
6768 | 6769 | | |
6769 | 6770 | | |
6770 | 6771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14084 | 14084 | | |
14085 | 14085 | | |
14086 | 14086 | | |
14087 | | - | |
14088 | 14087 | | |
14089 | 14088 | | |
14090 | 14089 | | |
| |||
15529 | 15528 | | |
15530 | 15529 | | |
15531 | 15530 | | |
15532 | | - | |
| 15531 | + | |
| 15532 | + | |
15533 | 15533 | | |
15534 | 15534 | | |
15535 | 15535 | | |
15536 | | - | |
| 15536 | + | |
| 15537 | + | |
15537 | 15538 | | |
15538 | 15539 | | |
15539 | 15540 | | |
| |||
15542 | 15543 | | |
15543 | 15544 | | |
15544 | 15545 | | |
15545 | | - | |
| 15546 | + | |
15546 | 15547 | | |
15547 | 15548 | | |
15548 | 15549 | | |
| |||
15553 | 15554 | | |
15554 | 15555 | | |
15555 | 15556 | | |
15556 | | - | |
15557 | | - | |
| 15557 | + | |
| 15558 | + | |
| 15559 | + | |
| 15560 | + | |
15558 | 15561 | | |
15559 | 15562 | | |
15560 | 15563 | | |
15561 | 15564 | | |
15562 | | - | |
| 15565 | + | |
15563 | 15566 | | |
15564 | 15567 | | |
15565 | 15568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18105 | 18105 | | |
18106 | 18106 | | |
18107 | 18107 | | |
| 18108 | + | |
| 18109 | + | |
18108 | 18110 | | |
18109 | 18111 | | |
18110 | 18112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
0 commit comments