[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-15 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155616. acomminos added a comment. Remove `const` qualifier for SourceRange. Repository: rC Clang https://reviews.llvm.org/D48845 Files: include/clang/Sema/DeclSpec.h include/clang/Sema/ScopeInfo.h include/clang/Sema/Sema.h

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-13 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155472. acomminos marked an inline comment as done. acomminos added a comment. Use source ranges instead of a pair of source locations for explicit lambda captures. Repository: rC Clang https://reviews.llvm.org/D48845 Files:

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-13 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos marked an inline comment as done. acomminos added inline comments. Comment at: include/clang/Sema/DeclSpec.h:2552-2553 ParsedType InitCaptureType; +SourceLocation LocStart; +SourceLocation LocEnd; + aaron.ballman wrote: > aaron.ballman

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-13 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155446. acomminos marked 2 inline comments as done. acomminos added a comment. Add test for stateful initializer expressions not being removed, propagate whether or not a diagnostic actually get emitted. Repository: rC Clang

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-13 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155430. acomminos marked 2 inline comments as done. acomminos added a comment. Elide braces in single-line conditional. Repository: rC Clang https://reviews.llvm.org/D48845 Files: include/clang/Sema/DeclSpec.h include/clang/Sema/ScopeInfo.h

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-13 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155428. acomminos marked 2 inline comments as done. acomminos added a comment. Thanks! Updated to be more explicit about location names, add more tests for VLA and *this captures, and fix an issue with VLA range captures invalidating the capture range

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-12 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 155246. acomminos added a comment. Thanks for the feedback! This diff switches to using a source range for captures provided by the parser, which is more accurate, future-proof, and correctly handles macros. Repository: rC Clang

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-05 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 154313. acomminos added a comment. Add additional tests to ensure that explicit capture ranges are predicted correctly. Repository: rC Clang https://reviews.llvm.org/D48845 Files: include/clang/Sema/Sema.h lib/Sema/SemaLambda.cpp

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-05 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 154307. acomminos added a comment. Handle initialization expressions and dereferenced `this` in lambda captures. An alternative to handling various kinds of explicit captures would be propagating the source range for each lambda capture from the parser to

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-03 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos planned changes to this revision. acomminos added a comment. Ah yes, thanks for pointing this out. Some additional logic is going to be necessary to handle capture initializers correctly- I'll look into exposing full source ranges in LambdaCapture to make this more consistent across

[PATCH] D48845: [Sema] Add fixit for unused lambda captures

2018-07-03 Thread Andrew Comminos via Phabricator via cfe-commits
acomminos updated this revision to Diff 153968. acomminos retitled this revision from "[Sema] Add fixit for -Wno-unused-lambda-capture" to "[Sema] Add fixit for unused lambda captures". acomminos edited the summary of this revision. acomminos changed the visibility from "Custom Policy" to "Public