Commit 5805e4d
authored
[ADT] Use static_assert in PackedVector (#164142)
This patch replaces an intentionally undefined template
specialization:
template <typename T> class PackedVector<T, 0>;
with:
static_assert(BitNum > 0, "BitNum must be > 0");
This way, the compiler diagnostic on a use of PackedVector<T, 0>
improves from:
error: implicit instantiation of undefined template
'llvm::PackedVector<unsigned int, 0>'
to:
error: static assertion failed due to requirement '0U > 0': BitNum
must be > 01 parent a0a840a commit 5805e4d
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
0 commit comments