Commit 4ca4133
committed
Fix false positives in RULE-6-9-2/A3-9-1 for auto-deduced types
Variables declared with 'auto' or 'decltype(auto)' should not be flagged
when the deduced type resolves through fixed-width typedefs (e.g. uint32_t)
to a built-in integer type. The programmer never explicitly wrote a
variable-width type name in these cases.
This is analogous to the existing template instantiation exclusion (#540).
Fixes: #11451 parent 883a46f commit 4ca4133
4 files changed
Lines changed: 20 additions & 0 deletions
File tree
- change_notes
- cpp/common
- src/codingstandards/cpp/rules/variablewidthintegertypesused
- test/rules/variablewidthintegertypesused
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
0 commit comments