[clang] [Format] Fix isStartOfName to recognize attributes (PR #76804)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 06:35:02 PST 2024


================
@@ -1698,8 +1698,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
           /*BasedOnStyle=*/"google",
       },
   };
-  GoogleStyle.AttributeMacros.push_back("GUARDED_BY");
----------------
ilya-biryukov wrote:

I think we should postpone the inclusion of those names into `AtrributeMacros`  and land the patch as is.

It seems that there is agreement among everyone that having this formatting without explicit `AtrributeMacros` is desirable, so landing as is is a no-brainer.

Whether we should add common macro names into `AttributeMacros` is more contentious, so I think we may need more data to back up our decision to go either way. I have some examples where not having those names in the config leads to undesirable formatting, but I would share them in a follow-up conversation.

https://github.com/llvm/llvm-project/pull/76804


More information about the cfe-commits mailing list