This revision was automatically updated to reflect the committed changes.
Closed by commit rL342194: [Sema] Remove location from implicit capture init
expr (authored by vedantk, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D50927?vs=
This revision was automatically updated to reflect the committed changes.
Closed by commit rC342194: [Sema] Remove location from implicit capture init
expr (authored by vedantk, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50927?vs=162918&id=165400#toc
Repository:
rL LL
rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/Sema/SemaLambda.cpp:1422-1424
auto Entity = InitializedEntity::InitializeLambdaCapture(
Var->getIdentifier(), Field->getType(), Loc);
I
vsk added inline comments.
Comment at: clang/lib/Sema/SemaLambda.cpp:1422-1424
auto Entity = InitializedEntity::InitializeLambdaCapture(
Var->getIdentifier(), Field->getType(), Loc);
InitializationKind InitKind = InitializationKind::CreateDirect(Loc, Loc,
Loc);
vsk updated this revision to Diff 162918.
vsk marked 2 inline comments as done.
vsk added a comment.
Address the latest round of review feedback.
https://reviews.llvm.org/D50927
Files:
clang/lib/Sema/SemaLambda.cpp
clang/test/CXX/expr/expr.prim/expr.prim.lambda/p14.cpp
clang/test/CXX/expr
rsmith added inline comments.
Comment at: clang/lib/Sema/SemaLambda.cpp:1422-1424
auto Entity = InitializedEntity::InitializeLambdaCapture(
Var->getIdentifier(), Field->getType(), Loc);
InitializationKind InitKind = InitializationKind::CreateDirect(Loc, Loc,
Loc);
-
vsk updated this revision to Diff 162764.
vsk added a comment.
- Partially address some of @rsmith's feedback. Instead of using the capture
default location, I used the beginning location of the capture list. This
results in smoother single-stepping when those two locations are on different
lin
vsk added inline comments.
Comment at: clang/lib/Sema/SemaDecl.cpp:10689
- S.DiagRuntimeBehavior(DRE->getBeginLoc(), DRE,
+ S.DiagRuntimeBehavior(DRE->getBeginOrDeclLoc(), DRE,
S.PDiag(diag)
rsmith wrote:
> I'm a bit surpr
rsmith added a comment.
I would prefer that we use the location of the capture-default as the location
of all the implicitly captured fields, rather than using an invalid location.
Comment at: clang/lib/Sema/SemaDecl.cpp:10689
- S.DiagRuntimeBehavior(DRE->getBeginLoc(),
vsk added a comment.
Ping.
https://reviews.llvm.org/D50927
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vsk updated this revision to Diff 161536.
vsk added a comment.
- Here is a GIF that might help illustrate the bug:
http://net.vedantk.com/static/llvm/lambda-implicit-capture-bug.gif
- Update test/SemaCXX/uninitialized.cpp to highlight the behavior change which
comes from using getBeginOrDeclLoc(
vsk created this revision.
vsk added reviewers: rsmith, rtrieu, erichkeane.
A lambda's closure is initialized when the lambda is declared. For
implicit captures, the initialization code emitted from EmitLambdaExpr
references source locations *within the lambda body* in the function
containing the
12 matches
Mail list logo