[PATCH] D137486: [clang-format] Correctly annotate function names before attributes

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 02:00:32 PST 2022


owenpan added inline comments.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:76
+static bool isCppAttribute(bool IsCpp, const FormatToken &Tok) {
+  if (!IsCpp || !Tok.startsSequence(tok::l_square, tok::l_square))
+    return false;
----------------
HazardyKnusperkeks wrote:
> What about  `__declspec`, or `__attribute__(())`?
I was only refactoring here. I suppose `isCpp11AttributeSpecifier` was added to specifically handle attributes starting with `[[` as the name suggests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137486



More information about the cfe-commits mailing list