[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture

2018-10-04 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a comment. @rsmith, friendly ping. I'm not in a rush on this one, but I know you wanted to see an improvement in lambda capture diagnostics. https://reviews.llvm.org/D52064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture

2018-09-13 Thread Vedant Kumar via Phabricator via cfe-commits
vsk updated this revision to Diff 165403. vsk marked an inline comment as done. https://reviews.llvm.org/D52064 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Frontend/FrontendActions.cpp clang/lib/Sema/SemaLambda.cpp clang/lib/Sema/Sem

[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture

2018-09-13 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added inline comments. Comment at: clang/test/SemaCXX/lambda-expressions.cpp:87 +(void)^{ // expected-error@+1 {{no matching constructor for initialization of 'const G'}} + return [=]{ // expected-error@+1 {{no matching constructor for initialization of 'const G'}}

[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture

2018-09-13 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaLambda.cpp:1427 if (RefResult.isInvalid()) return ExprError(); Expr *Ref = RefResult.get(); This early exit leaves your CodeSynthesisContext on the stack. Consider using RAII?

[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture

2018-09-13 Thread Vedant Kumar via Phabricator via cfe-commits
vsk created this revision. vsk added reviewers: rsmith, erichkeane. When it's not possible to initialize an implicit capture, add a note pointing to the first use of the captured variable. Example (the `note` is new): lambda-expressions.cpp:81:15: error: no matching constructor for initializatio