Commit acfbb0f
committed
Fix bsl-non-safe-integral-types-are-forbidden
Non-safe integral types are forbidden except when declared within a
struct. The current check is done on the direct parent of a declaration
being a struct which is missing the case of when a struct is further up
the ancestry.
For example, non-safe integral field declared within a union or any
nested unions, all descendants of a struct would cause the following
warning (treated as an error here) to trigger:
```
error: integral types like int, std::int32_t and bsl::int32 are forbidden. Use bsl::safe_integral instead of 'bsl::uint64' [bsl-non-safe-integral-types-are-forbidden,-warnings-as-errors]
bsl::uint64 reg0;
^
```1 parent 1b019f9 commit acfbb0f
File tree
1 file changed
+10
-0
lines changed- clang-tools-extra/clang-tidy/bsl
1 file changed
+10
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
0 commit comments