[PATCH] D106732: Support macro deprecation #pragma clang deprecated

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 26 08:50:31 PDT 2021


beanz added a comment.

Will update the patch later today with your feedback.



================
Comment at: clang/docs/LanguageExtensions.rst:3875
+   #define MIN(x, y) x < y ? x : y
+   #pragma clang deprecated("MIN", "use std::min instead")
+
----------------
aaron.ballman wrote:
> Rather than use a string literal, did you consider using an unexpanded identifier token?
The Lexer expands preprocessor macros, so you wouldn't get an identifier token, you actually get the tokens inside the macro. I suspect this is why `#pragma push_macro` does the same thing and uses a string literal.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106732/new/

https://reviews.llvm.org/D106732



More information about the cfe-commits mailing list