Skip to content

Clang should inform users of the possible places to put attributes #155787

@philnik777

Description

@philnik777

Given e.g.

void func2() {
  [[maybe_unused]] using T = int;
}

Clang currently only produces the error an attribute list cannot appear here. It would be really nice if Clang could add a note like

note: Did you mean to put the attribute here?
[[maybe_unused]] using T = int;
                        ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions