ObjCXX: fix a crash during typo correction.
authorManman Ren <manman.ren@gmail.com>
Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)
committerManman Ren <manman.ren@gmail.com>
Tue, 2 Feb 2016 22:23:03 +0000 (22:23 +0000)
commit8abc2e51b81efe2f540f6a61a3028f8fe72fe478
tree2556dd45ca4238752886651c46b6d3dd0b338a19
parentc67466054f8dd467283f17fd31c2c7763ab25016
ObjCXX: fix a crash during typo correction.

For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion
and SubExpr being BlockExpr. Specifically one can return BlockExpr from
BuildCXXMemberCallExpr and the result can be used to build a CastExpr.

Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only
be CXXMemberCallExpr.

rdar://problem/24364077

llvm-svn: 259591
clang/lib/AST/Expr.cpp
clang/test/SemaObjCXX/block-for-lambda-conversion.mm [new file with mode: 0644]