https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122667
Bug ID: 122667
Summary: Please provide a way to deprecate macros (like Clang's
`#pragma clang deprecate(MACRO)`)
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marc.mutz at hotmail dot com
Target Milestone: ---
There currently appears to be no way to mark a preprocessor macro as being
deprecated.
In libc++, they deprecate ATOMIC_VAR_INIT using `#pragma clang
deprecated(ATOMIC_VAR_INIT)`, but that pragma is not supported by GCC.
libstdc++ will need something like this to deprecate ATOMIC_VAR_INIT. Fallbacks
like injecting a deprecated function call into the macro expansion don't always
work (cf. ATOMIC_VAR_INIT) and when they do, they're user-unfriendly, because
the compiler is complaining about a function that's invisible in the source.