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.
llvm-svn: 65070
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 540a637..51c581a 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/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