[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
Fri Jan 23 08:50:19 PST 2026


================
@@ -0,0 +1,20 @@
+// Test that -fms-anonymous-structs is a CC1-only option and is accepted by CC1 without error.
+
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fms-anonymous-structs %s -fsyntax-only 2>&1 | \
+// RUN:     FileCheck --check-prefix=CC1-OK %s --allow-empty
+// CC1-OK-NOT: error: unknown argument
+
+// Test that multiple occurrences are handled
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fms-anonymous-structs -fms-anonymous-structs %s -fsyntax-only 2>&1 | \
+// RUN:     FileCheck --check-prefix=MULTI-OK %s --allow-empty
+// MULTI-OK-NOT: error: unknown argument
----------------
hubert-reinterpretcast wrote:

Can simply reuse the `CC1-OK` prefix.
```suggestion
// RUN:     FileCheck --check-prefix=CC1-OK %s --allow-empty
```

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


More information about the cfe-commits mailing list