forked from OSchip/llvm-project
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:
parent
cada2d8d1e
commit
a174241cf1
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue