This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Correctly annotate function names before attributes
ClosedPublic

Authored by owenpan on Nov 5 2022, 4:16 AM.

Diff Detail

Event Timeline

owenpan created this revision.Nov 5 2022, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2022, 4:16 AM
owenpan requested review of this revision.Nov 5 2022, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2022, 4:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rymiel added a comment.Nov 5 2022, 4:32 AM

Are both isCpp11AttributeSpecifier and isCppAttribute required?

Are both isCpp11AttributeSpecifier and isCppAttribute required?

Not really, but I've kept isCpp11AttributeSpecifier for now as it might become handy if it needs to be called at other places when we add an option for breaking after C++ attributes. Otherwise, I will remove it in a separate patch.

HazardyKnusperkeks added inline comments.
clang/lib/Format/TokenAnnotator.cpp
76

What about __declspec, or __attribute__(())?

This revision is now accepted and ready to land.Nov 6 2022, 10:50 AM
owenpan added inline comments.Nov 7 2022, 2:00 AM
clang/lib/Format/TokenAnnotator.cpp
76

I was only refactoring here. I suppose isCpp11AttributeSpecifier was added to specifically handle attributes starting with [[ as the name suggests.

This revision was landed with ongoing or failed builds.Nov 12 2022, 12:43 AM
This revision was automatically updated to reflect the committed changes.