allow cast from array to int to be considered as constant
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63519 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 7d7badd..fe7ab92 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2075,8 +2075,7 @@
if (SubExpr->getType()->isPointerType()) {
const Expr* Base = FindExpressionBaseAddress(SubExpr);
// If the pointer has a null base, this is an offsetof-like construct
- if (!Base)
- return CheckAddressConstantExpression(SubExpr);
+ return Base ? false : CheckAddressConstantExpression(SubExpr);
}
InitializerElementNotConstant(Init);