[PATCH] D52064: [Sema] Add a note pointing to the first use of an implicit capture
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 13 16:49:19 PDT 2018
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?
================
Comment at: clang/test/SemaCXX/lambda-expressions.cpp:87
+ (void)^{ // expected-error at +1 {{no matching constructor for initialization of 'const G'}}
+ return [=]{ // expected-error at +1 {{no matching constructor for initialization of 'const G'}}
+ const G* gg = &g; // expected-note {{implicitly capturing 'g', first used here}}
----------------
Why are these @+1?
https://reviews.llvm.org/D52064
More information about the cfe-commits
mailing list