Sema: correct typo recovery with blocks

Handle blocks in the tree transform for the typo correction as otherwise, the
capture may miss.  This would trigger an assertion.  Thanks to Doug Gregor for
the help with this!

Fixes PR25001.

llvm-svn: 251729
This commit is contained in:
Saleem Abdulrasool 2015-10-31 00:39:15 +00:00
parent cada2d8d1e
commit a174241cf1
2 changed files with 14 additions and 0 deletions

View File

@ -6545,6 +6545,8 @@ public:
ExprResult TransformLambdaExpr(LambdaExpr *E) { return Owned(E); }
ExprResult TransformBlockExpr(BlockExpr *E) { return Owned(E); }
ExprResult Transform(Expr *E) {
ExprResult Res;
while (true) {

View File

@ -0,0 +1,12 @@
// RUN: %clang_cc1 -triple i386-apple-macosx -fblocks -fsyntax-only -verify %s
extern int h(int *);
extern void g(int, void (^)(void));
extern int fuzzys; // expected-note {{'fuzzys' declared here}}
static void f(void *v) {
g(fuzzy, ^{ // expected-error {{did you mean 'fuzzys'}}
int i = h(v);
});
}