Skip to content

Compiler no longer accepting certain form of deprecated attribute after commit 8c7b64b5ae2a #56077

@dyung

Description

@dyung

One of our internal tests started giving a compile error on a deprecated attribute lately and I bisected it back to commit 8c7b64b. Consider the following code:

[[deprecated( "use bar instead" )]]
extern "C" int foo();

When compiled using a compiler built prior to 8c7b64b, this code would compile cleanly. However, once we try a compiler built that includes 8c7b64b, we get an error:

$ ~/src/upstream/8c7b64b5ae2a-linux/bin/clang -c test.cpp
test.cpp:1:1: error: an attribute list cannot appear here
[[deprecated( "use bar instead" )]]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

I believe this should be a valid form of the deprecated attribute and the compiler seems to be parsing it incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"questionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions