Commit b93c10f
committed
[clang][dataflow] For bugprone-unchecked-optional-access report range
Report the range in diagnostics, in addition to the location
in case the range helps disambiguate a little in chained `->` expressions.
b->a->f->x = 1;
^~~~~~~
instead of just:
b->a->f->x = 1;
^
As a followup we should probably also report the location/range
of an `->` if that operator is used. Like:
b->a->f->x = 1;
^~1 parent e4a0fd5 commit b93c10f
File tree
4 files changed
+31
-21
lines changed- clang-tools-extra/clang-tidy/bugprone
- clang
- include/clang/Analysis/FlowSensitive/Models
- lib/Analysis/FlowSensitive/Models
- unittests/Analysis/FlowSensitive
4 files changed
+31
-21
lines changedLines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | | - | |
| 65 | + | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
74 | 80 | | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | | - | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
87 | | - | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
1123 | | - | |
1124 | | - | |
| 1123 | + | |
| 1124 | + | |
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
| 1135 | + | |
| 1136 | + | |
1138 | 1137 | | |
1139 | 1138 | | |
1140 | 1139 | | |
| |||
1143 | 1142 | | |
1144 | 1143 | | |
1145 | 1144 | | |
1146 | | - | |
1147 | | - | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
1339 | | - | |
| 1339 | + | |
1340 | 1340 | | |
1341 | 1341 | | |
1342 | 1342 | | |
| |||
1369 | 1369 | | |
1370 | 1370 | | |
1371 | 1371 | | |
1372 | | - | |
1373 | | - | |
| 1372 | + | |
| 1373 | + | |
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
1377 | 1377 | | |
1378 | 1378 | | |
1379 | 1379 | | |
1380 | | - | |
| 1380 | + | |
1381 | 1381 | | |
1382 | | - | |
| 1382 | + | |
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
| |||
0 commit comments