Commit cecae35
committed
Cap IntRange::Width to the expression's type size
This commit addresses a fallout introduced by #126846.
Previously, TryGetExprRange would return an IntRange that has an active
range exceeding the maximum representable range for the expression's
underlying type. This led to clang erroneously issuing warnings about
implicit conversions losing integer precision.
This commit fixes the bug by capping IntRange::Width to the size of the
expression's type.
rdar://1494440291 parent 3dc9f2d commit cecae35
File tree
2 files changed
+12
-2
lines changed- clang
- lib/Sema
- test/Sema
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10808 | 10808 | | |
10809 | 10809 | | |
10810 | 10810 | | |
10811 | | - | |
| 10811 | + | |
10812 | 10812 | | |
10813 | 10813 | | |
10814 | 10814 | | |
| |||
10825 | 10825 | | |
10826 | 10826 | | |
10827 | 10827 | | |
10828 | | - | |
| 10828 | + | |
| 10829 | + | |
| 10830 | + | |
10829 | 10831 | | |
10830 | 10832 | | |
10831 | 10833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
0 commit comments