summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-05-08 03:34:22 +0000
committerJohn McCall <rjmccall@apple.com>2013-05-08 03:34:22 +0000
commit1b4259b53b24d42552f1242a80b07ddf12203940 (patch)
treeae9188e00423ed8ad2e8a4d8920f5ab2720e8b8f /clang/lib/Sema
parent220dd334468e8dbfc3b3b5d21fea24ed01a602b4 (diff)
downloadbcm5719-llvm-1b4259b53b24d42552f1242a80b07ddf12203940.tar.gz
bcm5719-llvm-1b4259b53b24d42552f1242a80b07ddf12203940.zip
In block enum-return inference, don't die on loads of enum lvalues.
More of rdar://13200889. llvm-svn: 181390
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index c7ba3cc822f..24388dd0f52 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -275,11 +275,12 @@ static EnumDecl *findEnumForBlockReturn(Expr *E) {
// - it is an implicit integral conversion applied to an
// enumerator-like expression of type T or
if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(E)) {
- // We can only see integral conversions in valid enumerator-like
- // expressions.
+ // We can sometimes see integral conversions in valid
+ // enumerator-like expressions.
if (ICE->getCastKind() == CK_IntegralCast)
return findEnumForBlockReturn(ICE->getSubExpr());
- return 0;
+
+ // Otherwise, just rely on the type.
}
// - it is an expression of that formal enum type.
OpenPOWER on IntegriCloud