Issue 202391
Summary pragma deprecated is not always wrappeable inside another macro
Labels new issue
Assignees
Reporter jpboivin
    Hello,

We've tried leveraging `#pragma clang deprecated`, but faced an issue where due to its design (i.e. taking the macro name directly, and not as a stringified form), it is impossible to wrap in a `DEPRECATED_MACRO` proxy (that would for example also support MSVC). While it works well with the example given in the clang documentation (i.e. `MIN(a,b)`), it doesn't work with macros that are parameterless, as they will get expanded before being stringified for the `_Pragma` directive. I've tried many tricks to prevent the expansion, without success. I think the only way to truely prevent expansion would be to stringy the macro name, but that would require support form `#pragma clang deprecated`.

Here is some code sample:
https://godbolt.org/z/s69T7sPGY
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to