Skip to content

Commit 3f07850

Browse files
committed
Add more assert(false)
1 parent 2003a75 commit 3f07850

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

clang/lib/AST/Interp/IntegralAP.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ template <bool Signed> class IntegralAP final {
100100
return IntegralAP(0);
101101
}
102102

103+
// FIXME: This can't be static if the bitwidth depends on V.
103104
static constexpr unsigned bitWidth() { return 128; }
104105

105106
APSInt toAPSInt(unsigned Bits = 0) const { return V; }
@@ -117,7 +118,11 @@ template <bool Signed> class IntegralAP final {
117118

118119
void print(llvm::raw_ostream &OS) const { OS << V; }
119120

120-
IntegralAP truncate(unsigned bitWidth) const { return V; }
121+
IntegralAP truncate(unsigned bitWidth) const {
122+
assert(false);
123+
return V;
124+
}
125+
121126
IntegralAP<false> toUnsigned() const {
122127
APSInt Copy = V;
123128
Copy.setIsSigned(false);
@@ -129,11 +134,13 @@ template <bool Signed> class IntegralAP final {
129134
}
130135

131136
static bool increment(IntegralAP A, IntegralAP *R) {
137+
assert(false);
132138
*R = IntegralAP(A.V + 1);
133139
return false;
134140
}
135141

136142
static bool decrement(IntegralAP A, IntegralAP *R) {
143+
assert(false);
137144
*R = IntegralAP(A.V - 1);
138145
return false;
139146
}

0 commit comments

Comments
 (0)