Files
clang-p2996/clang/lib/Format/TokenAnnotator.cpp
Ilya Biryukov 5723fce088 [Format] Fix isStartOfName to recognize attributes (#76804)
This addresses a problem with formatting attributes. Some context:
- eaff083035 changed `isStartOfName` to fix problems inside
`#pragma`s, but this behavior changed formatting of attribute macros in
an undesirable way.
- efeb546865 changed Google format style
to fix some widely used attributes.

Instead of changing the format style, this commit specializes behavior
introduced in eaff083035 to `#pragma`s. This seems to work well in
both cases.

Also update the test with two `GUARDED_BY` directives. While the
formatting after efeb546865 seems better,
this case is rare enough to not warrant the extra complexity. We are
reverting it back to the state it had before
efeb546865.

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>
2024-01-15 14:57:05 +01:00

221 KiB