Skip to content

GNU attributes preceding standard attributes are rejected #58229

Closed
@compnerd

Description

@compnerd

The following exemplifies the problem:

__attribute__((__visibility__("default"))) [[nodiscard]] int f();
[[nodiscard]] __attribute__((__visibility__("default"))) int f();

While GCC accepts both, clang will refuse the first one.

This is currently "expected" behaviour: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Parse/Parser.h#L2774-L2778

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"rejects-valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions