forked from OSchip/llvm-project
SemaExpr.cpp - use castAs<> instead of getAs<> as we dereference the pointer directly. NFCI.
castAs<> will assert the correct cast type instead of just returning null, which we then try to dereference immediately.
This commit is contained in:
parent
9d996c01aa
commit
88bb265670
|
@ -3778,8 +3778,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) {
|
|||
|
||||
if (Ty == Context.DoubleTy) {
|
||||
if (getLangOpts().SinglePrecisionConstants) {
|
||||
const BuiltinType *BTy = Ty->getAs<BuiltinType>();
|
||||
if (BTy->getKind() != BuiltinType::Float) {
|
||||
if (Ty->castAs<BuiltinType>()->getKind() != BuiltinType::Float) {
|
||||
Res = ImpCastExprToType(Res, Context.FloatTy, CK_FloatingCast).get();
|
||||
}
|
||||
} else if (getLangOpts().OpenCL &&
|
||||
|
|
Loading…
Reference in New Issue