Commit 5bbe153
authored
Cap IntRange::Width to MaxWidth (#145356)
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 MaxWidth.
rdar://1494440291 parent 0f87c78 commit 5bbe153
File tree
2 files changed
+14
-5
lines changed- clang
- lib/Sema
- test/Sema
2 files changed
+14
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10805 | 10805 | | |
10806 | 10806 | | |
10807 | 10807 | | |
10808 | | - | |
10809 | | - | |
10810 | | - | |
10811 | | - | |
| 10808 | + | |
| 10809 | + | |
| 10810 | + | |
10812 | 10811 | | |
10813 | 10812 | | |
10814 | 10813 | | |
| |||
10825 | 10824 | | |
10826 | 10825 | | |
10827 | 10826 | | |
10828 | | - | |
| 10827 | + | |
| 10828 | + | |
| 10829 | + | |
10829 | 10830 | | |
10830 | 10831 | | |
10831 | 10832 | | |
| |||
| 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