[clang] [clang] Accept empty enum in MSVC compatible C (PR #159981)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 22 19:03:10 PDT 2025
================
@@ -5360,7 +5360,8 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl,
T.consumeOpen();
// C does not allow an empty enumerator-list, C++ does [dcl.enum].
- if (Tok.is(tok::r_brace) && !getLangOpts().CPlusPlus)
+ if (Tok.is(tok::r_brace) && !getLangOpts().CPlusPlus &&
+ !getLangOpts().MSVCCompat && !getLangOpts().MicrosoftExt)
----------------
Sirraide wrote:
I’m pretty sure passing `-fms-compatibility` also enables `-fms-extensions` (at least that’s what I gathered from looking at `Options.td` earlier); maybe that’s just not the case if you pass it as a `-cc1` flag?
https://github.com/llvm/llvm-project/pull/159981
More information about the cfe-commits
mailing list