Index: cfe/trunk/lib/Parse/ParseExprCXX.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseExprCXX.cpp +++ cfe/trunk/lib/Parse/ParseExprCXX.cpp @@ -966,6 +966,8 @@ // that would be an error. ParsedType InitCaptureType; + if (!Init.isInvalid()) + Init = Actions.CorrectDelayedTyposInExpr(Init.get()); if (Init.isUsable()) { // Get the pointer and store it in an lvalue, so we can use it as an // out argument. Index: cfe/trunk/test/SemaCXX/cxx1y-init-captures.cpp =================================================================== --- cfe/trunk/test/SemaCXX/cxx1y-init-captures.cpp +++ cfe/trunk/test/SemaCXX/cxx1y-init-captures.cpp @@ -206,3 +206,11 @@ find(weight); // expected-note {{in instantiation of function template specialization}} } } + +namespace init_capture_undeclared_identifier { + auto a = [x = y]{}; // expected-error{{use of undeclared identifier 'y'}} + + int typo_foo; // expected-note 2 {{'typo_foo' declared here}} + auto b = [x = typo_boo]{}; // expected-error{{use of undeclared identifier 'typo_boo'; did you mean 'typo_foo'}} + auto c = [x(typo_boo)]{}; // expected-error{{use of undeclared identifier 'typo_boo'; did you mean 'typo_foo'}} +}