From 7946dd363beaa92e8d03ef199ffedaab58714058 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 27 Aug 2007 17:24:30 +0000 Subject: [PATCH] C++ allows empty enum list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41498 91177308-0d34-0410-b5e6-96231b3b80d8 --- Parse/ParseDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp index 6a617128ad..8a03184178 100644 --- a/Parse/ParseDecl.cpp +++ b/Parse/ParseDecl.cpp @@ -803,7 +803,8 @@ void Parser::ParseEnumSpecifier(DeclSpec &DS) { void Parser::ParseEnumBody(SourceLocation StartLoc, DeclTy *EnumDecl) { SourceLocation LBraceLoc = ConsumeBrace(); - if (Tok.getKind() == tok::r_brace) + // C does not allow an empty enumerator-list, C++ does [dcl.enum]. + if (Tok.getKind() == tok::r_brace && !getLang().CPlusPlus) Diag(Tok, diag::ext_empty_struct_union_enum, "enum"); llvm::SmallVector EnumConstantDecls; -- 2.40.0