Commit 7e677c5
Zeeshan Siddiqui
[Sema] Make incorrect-logic operator check cast-agnostic
The check for tautological comparisons (e.g. `x != 0 || x != 1`)
failed on targets that support native scalar half precision because the
operands differed only by an implicit `FloatingCast`.
Extends Expr::isSameComparisonOperand() so that floating-rank promotions and
lvalue-to-rvalue conversions no longer block the unreachable-code diagnostic
on targets with native _Float16/__fp16.
Updates existing test exercising both `__fp16` (promoted) and `_Float16`
(native with +fullfp16) on x86-64 and AArch64.1 parent a194d51 commit 7e677c5
File tree
3 files changed
+45
-15
lines changed- clang
- docs
- lib/AST
- test/Sema
3 files changed
+45
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4233 | 4233 | | |
4234 | 4234 | | |
4235 | 4235 | | |
4236 | | - | |
4237 | | - | |
| 4236 | + | |
| 4237 | + | |
| 4238 | + | |
| 4239 | + | |
| 4240 | + | |
| 4241 | + | |
| 4242 | + | |
| 4243 | + | |
| 4244 | + | |
4238 | 4245 | | |
4239 | 4246 | | |
4240 | 4247 | | |
| |||
4244 | 4251 | | |
4245 | 4252 | | |
4246 | 4253 | | |
4247 | | - | |
| 4254 | + | |
| 4255 | + | |
4248 | 4256 | | |
4249 | 4257 | | |
4250 | 4258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
16 | 33 | | |
0 commit comments