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
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
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'}}
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?
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