diff options
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index c54fc40ecb2..c320cfc6701 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -733,6 +733,12 @@ bool Expr::isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { /// cast+dereference. bool Expr::isIntegerConstantExpr(llvm::APSInt &Result, ASTContext &Ctx, SourceLocation *Loc, bool isEvaluated) const { + // Pretest for integral type; some parts of the code crash for types that + // can't be sized. + if (!getType()->isIntegralType()) { + if (Loc) *Loc = getLocStart(); + return false; + } switch (getStmtClass()) { default: if (Loc) *Loc = getLocStart(); |

