C++ allows empty enum list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41498 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index 6a61712..8a03184 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -803,7 +803,8 @@
 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<DeclTy*, 32> EnumConstantDecls;