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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 14:41:37 PDT 2020


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: check if the next token is `TT_AttributeSquare` and only consume it in that case. Other languages that are using `TT_AttributeSquare` may have a different syntax for their attributes than `[[attribute]]`, e.g. recently added [[ https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/ | C# `[attributes]` ]].
I agree, in fact I had the same concern myself, I kind of assumed because we'd of seen

`[[ .... `]`  then it would be obvious that the next would be `]`

But on  reflection I think it could potentially be other things too


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79354/new/

https://reviews.llvm.org/D79354





More information about the cfe-commits mailing list