Page MenuHomePhabricator

Add `#pragma clang deprecated`, used to deprecate macros
Changes PlannedPublic

Authored by erik.pilkington on Sep 23 2019, 2:39 PM.



This patch adds support for #pragma clang deprecated, which emits a deprecated warning whenever it is encountered. This is intended to be used to deprecate macros, but it seems like it could be useful for deprecating include files as well (rather than #warning). This is similar to #pragma GCC warning, but that can't emit a diagnostic under -Wdeprecated, so these warnings wouldn't be controlled by traditional deprecation disabling methods. (-Wno-deprecated, #pragma clang diagnostic ignored).

rdar://problem/50356322 clang should provide a pragma to allow us to deprecate macros

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2019, 2:39 PM
erik.pilkington planned changes to this revision.Sep 24 2019, 12:10 PM

Marking as "planned changes" to get this out of review queues. Aaron Ballman wants to add "macro attributes", which would be a better way of solving this problem, and is going to ask the C and C++ committees if there is an appetite for such an idea. This is blocked on getting that answer.