[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 19 07:26:04 PST 2025


================
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility
+// expected-no-diagnostics
+
+typedef __typeof__(sizeof(0)) size_t;
+
+#if defined _MSC_VER && !defined _CRT_USE_BUILTIN_OFFSETOF
----------------
AaronBallman wrote:

We should also have a test for `#ifdef _CRT_USE_BUILTIN_OFFSETOF` to make it clear that we're testing that the macro is predefined.

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


More information about the cfe-commits mailing list