llvm-project/clang/test/Parser/ms-empty-enum.c
yicuixi 19a9de06cd
[clang] Accept empty enum in MSVC compatible C (#159981)
Fixes https://github.com/llvm/llvm-project/issues/114402.
This patch accept empty enum in C as a microsoft extension and introduce
an new warning `-Wmicrosoft-empty-enum`.

---------

Signed-off-by: yicuixi <qin_17914@126.com>
Co-authored-by: Erich Keane <ekeane@nvidia.com>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2025-11-05 14:43:40 +08:00

7 lines
505 B
C

// 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}}\
// expected-warning {{empty enumeration types are a Microsoft extension}}