summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/ExprConstant.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 9e1e75d7021..a12beb51792 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -1223,7 +1223,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExpr* E) {
}
case CK_ArrayToPointerDecay:
case CK_FunctionToPointerDecay:
- return EvaluateLValue(SubExpr, Result, Info);
+ if (SubExpr->isGLValue() || SubExpr->getType()->isFunctionType())
+ return EvaluateLValue(SubExpr, Result, Info);
+ return Error(E);
}
return ExprEvaluatorBaseTy::VisitCastExpr(E);
OpenPOWER on IntegriCloud