Skip to content

[clang-format] Improve support for AttributeMacro #68722

Closed
@jaredgrubb

Description

clang-format doesn't handle AttributeMacro in all the same ways as __attribute__ macros (which is means to emulate). For example, here are some things that don't format great, especially in ObjC:

// Attributes don't get a space between them sometimes:
- (id)init ATTRIBUTE_MACRO(X)ATTRIBUTE_MACRO;
- (id)init ATTRIBUTE_MACRO(X)__attribute__((X));

// @interface should go on its own line
ATTRIBUTE_MACRO(X) ATTRIBUTE_MACRO @interface Foo
@end

// Style: ColumnWidth smaller to require wrapping
// This indentation is really ugly.
ATTRIBUTE_MACRO
   ATTRIBUTE_MACRO(X)
   @interface Foo
@end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions