Commit 4405fc8
src: use stricter compile-time guidance
SnapshotSerializerDeserializer::GetName() appears to confuse static
analysis such as Coverity.
This changes the function structure to a sequence of if-else blocks and
marks all branch conditions as constexpr. (Unfortunately, this results
in a dangling 'else' keyword in the V macro.)
As per a request in the PR discussion, this change does _not_ ensure
that GetName<T>() can only be called for known types T and instead still
returns an empty string in that case.
Also use std::is_unsigned_v instead of !std::is_signed_v.
PR-URL: #46509
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>1 parent db95ed0 commit 4405fc8Copy full SHA for 4405fc8
File tree
Expand file treeCollapse file tree
1 file changed
+8
-11
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
1 file changed
+8
-11
lines changedOpen diff view settings
Collapse file
+8-11Lines changed: 8 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
166 | 166 | |
167 | 167 | |
168 | 168 | |
169 | | - |
| 169 | + |
170 | 170 | |
171 | | - |
| 171 | + |
172 | 172 | |
173 | 173 | |
174 | 174 | |
175 | | - |
176 | | - |
177 | | - |
178 | | - |
179 | | - |
180 | | - |
181 | | - |
182 | | - |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
183 | 180 | |
184 | | - |
| 181 | + |
185 | 182 | |
186 | 183 | |
187 | 184 | |
|
0 commit comments