[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-19 Thread Nicolas Lesser via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361119: Added a better diagnostic when using the delete operator with lambdas (authored by Rakete, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. LGTM, thank you! :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 ___ cfe-commits mailing list cfe-comm

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-15 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 199565. Rakete added a comment. - Fix crash with invalid postfix expr - Don't emit FixIt when using < Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: cl

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-15 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 199566. Rakete added a comment. - Use TryConsumeToken Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: clang/include/clang/Basic/DiagnosticParseKinds.td

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D36357#1501999 , @Rakete wrote: > In D36357#1501961 , @rsmith wrote: > > > In D36357#1500949 , @Rakete > > wrote: > > > > > How should I d

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 199528. Rakete marked an inline comment as done. Rakete added a comment. Nevermind, seems to be working fine even with. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.o

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete marked 2 inline comments as done. Rakete added a comment. In D36357#1501961 , @rsmith wrote: > In D36357#1500949 , @Rakete > wrote: > > > How should I do this? Do I just skip to the next `}`, or

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D36357#1500949 , @Rakete wrote: > How should I do this? Do I just skip to the next `}`, or also take into > account any additional scopes? Also does this mean that I skip and then > revert, because that seems pretty expens

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 199380. Rakete added a comment. - Addressed review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: clang/include/clang/Basic/DiagnosticParseKin

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete marked 3 inline comments as done. Rakete added a comment. > we could perform a tentative parse and skip to the } of the lambda. How should I do this? Do I just skip to the next `}`, or also take into account any additional scopes? Also does this mean that I skip and then revert,

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D36357#1491081 , @Rakete wrote: > @rsmith One last question: The fixit diagnostic seems to be inconsistent with > the rest? > > main.cpp:2:3: error: '[]' after delete interpreted as 'delete[]' > delete[] { return new i

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-05 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. Is this also okay? main.cpp:2:9: warning: lambda expressions are incompatible with C++98 [-Wc++98-compat] delete[] { return new int; } ^ main.cpp:2:3: error: '[]' after delete interpreted as 'delete[]'; add parentheses to treat this as a lambda-expr

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-05 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith One last question: The fixit diagnostic seems to be inconsistent with the rest? main.cpp:2:3: error: '[]' after delete interpreted as 'delete[]' delete[] { return new int; } ^~~~ ( ) Shouldn't the `^~~` be start

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-04 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. Thanks! Some minor nits, please feel free to commit once they're addressed. In D36357#1177852 , @Rakete wrote: > Note that clang doesn't support th

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-05-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 198142. Rakete added a comment. friendly ping :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: clang/include/clang/Basic/DiagnosticParseKinds.td cla

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2019-03-13 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 190435. Rakete added a comment. Rebase + friendly ping :). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D36357/new/ https://reviews.llvm.org/D36357 Files: clang/include/clang/Basic/DiagnosticParseKind

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-10-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 171421. Rakete added a comment. Rebase and friendly ping :) Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/FixIt/fixit-cxx0x.cpp test/Parser/cxx0x-lam

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-08-08 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 159832. Rakete added a comment. Rebase + friendly ping :) Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/FixIt/fixit-cxx0x.cpp test/Parser/cxx0x-lambd

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157642. Rakete added a comment. Addressed review comments. Note that clang doesn't support the fourth kind of lambda yet ([]<>), because https://reviews.llvm.org/D36527 hasn't been merged yet, so I didn't add a test case for that one. Repository:

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-26 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. This looks good, with some minor changes. Please add more test coverage, though, specifically: - test all four forms of lambda that we recognize after `delete` - add a test that the FixItHint is correct (maybe in test/FixIt/fixit-cxx0x.cpp, which checks that applying the

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-26 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 157611. Rakete added a comment. Rebased + friendly ping Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCX

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-13 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 155336. Rakete edited the summary of this revision. Rakete added a comment. Addressed review comments. Repository: rC Clang https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp tes

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-10 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Thanks! Comment at: lib/Parse/ParseExprCXX.cpp:2956 +const Token Next = GetLookAheadToken(2); +const auto GetAfter = [this] { return GetLookAheadToken(3); }; + I don't think this lambda is useful: since you're not caching the res

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-07-10 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 154882. Rakete added a comment. Rebased + friendly ping :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.cpp

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-06-28 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 153271. Rakete added a comment. Addressed review comments :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.cpp

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-06-21 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Parse/ParseExprCXX.cpp:2907-2909 +const Token Next = GetLookAheadToken(2); +const Token After = GetLookAheadToken(3); +const Token Last = GetLookAheadToken(4); Please don't request the additional lookahead

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-06-21 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith Should I only check for an identifier, like only "int" and nothing else? Because parsing a full type specifier might be a bit expensive, no? https://reviews.llvm.org/D36357 ___ cfe-commits mailing list cfe-commit

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added a comment. @rsmith Which type specifiers should I test for? just `T`? Or also `T*`, `T&`, ...? Now I'm just checking for an identifier, but anything else would make the lookahead more complicated I think. Any ideas? https://reviews.llvm.org/D36357 __

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-03-14 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 138335. Rakete added a comment. > Did you forget to upload the updated patch? This looks unchanged compared to > the prior version. Whoops, that's true. Sorry... https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Did you forget to upload the updated patch? This looks unchanged compared to the prior version. https://reviews.llvm.org/D36357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/li

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-16 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 130020. Rakete added a comment. Addressed review comments :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.cpp

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-05 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete added inline comments. Comment at: lib/Parse/ParseExprCXX.cpp:2906-2912 +// Basic lookahead to check if we have a lambda expression. If we +// encounter two braces with a semicolon, we can be pretty sure +// that this is a lambda, not say a compound literal

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: lib/Parse/ParseExprCXX.cpp:2906-2912 +// Basic lookahead to check if we have a lambda expression. If we +// encounter two braces with a semicolon, we can be pretty sure +// that this is a lambda, not say a compound literal. +

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2018-01-04 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 128668. Rakete added a comment. Rebased + friendly 2018 ping :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2017-12-01 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 125189. Rakete added a comment. Updated error message, added a FixItHint + a rebase and friendly ping :) https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expr

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2017-09-19 Thread Nicolas Lesser via Phabricator via cfe-commits
Rakete updated this revision to Diff 115881. Rakete added a project: clang. Rakete added a comment. Used better diagnostic id. https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2017-08-21 Thread Blitz Rakete via Phabricator via cfe-commits
Rakete updated this revision to Diff 112103. Rakete added a comment. Rebased and friendly ping. https://reviews.llvm.org/D36357 Files: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseExprCXX.cpp test/Parser/cxx0x-lambda-expressions.cpp test/SemaCXX/new-delete-0x.cpp

[PATCH] D36357: Added a better diagnostic when using the delete operator with lambdas

2017-08-05 Thread Blitz Rakete via Phabricator via cfe-commits
Rakete created this revision. This adds a new error for missing parentheses around lambdas in delete operators. int main() { delete []() { return new int(); }(); } This will result in: test.cpp:2:10: error: missing parentheses around lambda expression delete []() { return new