[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-09 Thread MyDeveloperDay via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG31fd12aa0956: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration (authored by MyDeveloperDay). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 262764. MyDeveloperDay added a comment. Address review comments and ensure existence of closing `]` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79354/new/ https://reviews.llvm.org/D79354 Files: clang/lib/Format/UnwrappedLineParser.cpp

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay marked an inline comment as done. MyDeveloperDay added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2431 +// Consume the closing TT_AttributeSquare. +nextToken(); + } krasimir wrote: > slight concern: c

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-07 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir accepted this revision. krasimir added a comment. This revision is now accepted and ready to land. Thank you! Looks good with a couple of nits. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2402 // it is often token-pasted. + // An [[attribute]] can be befor

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 262662. MyDeveloperDay added a comment. Change to TT_AttributeSquare CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79354/new/ https://reviews.llvm.org/D79354 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTe

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-07 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay planned changes to this revision. MyDeveloperDay marked an inline comment as done. MyDeveloperDay added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2405 tok::kw___attribute, tok::kw___declspec, -

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-06 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2405 tok::kw___attribute, tok::kw___declspec, -tok::kw_alignas) || +tok::kw_alignas, tok::l_square) ||

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay updated this revision to Diff 262231. MyDeveloperDay added a comment. Reduce false formatting CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79354/new/ https://reviews.llvm.org/D79354 Files: clang/lib/Format/UnwrappedLineParser.cpp clang/unittests/Format/FormatTest.cp

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. I'm not familiar with ObjC, but hope this helps: % cat ~/example.mm # left as-is by clang-format without D79354 (int)f : (int)arg { struct A as[] = {{a11, a12}, // {a21, a22}, // {nil, 0}}; retur

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. In D79354#2020722 , @krasimir wrote: > I have an example where this goes wrong in ObjC (modulo indentation): > > I think we should try harder to detect the beginning of an attribute > specifier. I think there may be a helpe

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added a comment. I have an example where this goes wrong in ObjC (modulo indentation): struct Stuff stuff[] = {

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-05 Thread Krasimir Georgiev via Phabricator via cfe-commits
krasimir added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2401 // The actual identifier can be a nested name specifier, and in macros // it is often token-pasted. while (FormatTok->isOneOf(tok::identifier, tok::coloncolon, tok::hashhash, --

[PATCH] D79354: [clang-format] [PR34574] Handle [[nodiscard]] attribute in class declaration

2020-05-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay created this revision. MyDeveloperDay added reviewers: krasimir, sammccall, marejde, mitchell-stellar. MyDeveloperDay added projects: clang, clang-format. https://bugs.llvm.org/show_bug.cgi?id=34574 https://bugs.llvm.org/show_bug.cgi?id=38401 template class [[nodiscard]] resul