Skip to content

Commit 651f4ce

Browse files
committed
[clang][Interp][NFC] Use constexpr if when possible in Integral.h
1 parent 0da7e40 commit 651f4ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/Interp/Integral.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ template <unsigned Bits, bool Signed> class Integral {
107107
return APSInt(APInt(Bits, static_cast<uint64_t>(V), Signed), !Signed);
108108
}
109109
APSInt toAPSInt(unsigned NumBits) const {
110-
if (Signed)
110+
if constexpr (Signed)
111111
return APSInt(toAPSInt().sextOrTrunc(NumBits), !Signed);
112112
else
113113
return APSInt(toAPSInt().zextOrTrunc(NumBits), !Signed);
@@ -171,7 +171,7 @@ template <unsigned Bits, bool Signed> class Integral {
171171
}
172172

173173
template <bool SrcSign> static Integral from(Integral<0, SrcSign> Value) {
174-
if (SrcSign)
174+
if constexpr (SrcSign)
175175
return Integral(Value.V.getSExtValue());
176176
else
177177
return Integral(Value.V.getZExtValue());

0 commit comments

Comments
 (0)