[clang] [clang] Accept empty enum in MSVC compatible C (PR #159981)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 29 09:01:25 PDT 2025


================
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 %s -fsyntax-only -Wmicrosoft -verify -fms-extensions
+
+typedef enum tag1 { } A; // expected-warning {{empty enumeration types are a Microsoft extension}}
+typedef enum tag2 { } B; // expected-warning {{empty enumeration types are a Microsoft extension}}
+typedef enum : unsigned { } C; // expected-warning {{enumeration types with a fixed underlying type are a Microsoft extension}}\
----------------
erichkeane wrote:

This shouldn't warn 2x, the 'with a fixed underlying type' version is sufficient.  

Also, isn't this a C23 extension, not a microsoft extension (or at least, as well)?  See: `ext_c23_enum_fixed_underlying_type`.


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


More information about the cfe-commits mailing list