[clang] [Frontend][Sema] Add CC1-only -fms-anonymous-structs to enable Microsoft anonymous struct/union feature (PR #176551)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 21 09:06:00 PST 2026


================
@@ -7156,8 +7156,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   // -fms-extensions=0 is default.
   if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions,
-                   IsWindowsMSVC || IsUEFI))
+                   IsWindowsMSVC || IsUEFI)) {
     CmdArgs.push_back("-fms-extensions");
+    CmdArgs.push_back("-fms-anonymous-structs");
----------------
hubert-reinterpretcast wrote:

@riyaz86a, thanks for confirming in our "offline" discussion that the implication mechanism of `ImpliedByAnyOf` is sufficient. As discussed, please remove the driver and driver test changes. Thanks.

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


More information about the cfe-commits mailing list