Add enough checking to ensure that non-constant block literals don't
appear to be constant. I'll probably redo this and throw it all away
later once we have codegen for BlockDeclRefExprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65070 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 540a637..51c581a 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -260,7 +260,11 @@
APValue VisitAddrLabelExpr(AddrLabelExpr *E)
{ return APValue(E, 0); }
APValue VisitCallExpr(CallExpr *E);
- APValue VisitBlockExpr(BlockExpr *E) { return APValue(E, 0); }
+ APValue VisitBlockExpr(BlockExpr *E) {
+ if (!E->hasBlockDeclRefExprs())
+ return APValue(E, 0);
+ return APValue();
+ }
APValue VisitConditionalOperator(ConditionalOperator *E);
};
} // end anonymous namespace