Skip to content

Don't issue a deprecated diagnostic when a deprecated macro is used in a deprecated definition #81359

@mordante

Description

@mordante

If a declaration itself is deprecated and uses deprecated functionality, the deprecation warning of the stuff it uses should be suppressed: https://godbolt.org/z/b839bqGj7. This looks like a Clang bug to me. Could you file one?

Originally posted by @philnik777 in #80542 (comment)

@AaronBallman

Oofda. I want to call this a bug, but it's going to be exceptionally hard to work around because of the difference in phases of translation. We issue the deprecated macro warning when the macro is expanded, which is long before we have any idea of how the value is being used. So it may be worth filing a QoI enhancement request over it, but I don't know that we have a way to improve it just yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions