[clang] [Clang] Support libstdc++ workarounds when using `-E` (PR #210802)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 06:28:59 PDT 2026


AaronBallman wrote:

> I like this approach a lot, in that in think the approach is workable. However I'm concerned that it's too ad-hoc. We know we will want to preserve _MSC_VER too, for example (but also __INTRIN_H, maybe other)
> 
> can we do `#pragma clang define name value` ?

@Sirraide and I talked about that approach and I would *really* prefer to avoid it because it opens up all kinds of messy problems that require careful thought. e.g., do we also then need an undefine because users can define and undefine the macros? what happens if the user does `#define FOO _Pragma("clang define name value")`? That kind of thing.

We convinced ourselves that it makes more sense to do a non-general solution here because we want this to stay in the realm of "implementation detail hack" and not "something users should use themselves".

WDYT?

https://github.com/llvm/llvm-project/pull/210802


More information about the cfe-commits mailing list