diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-27 17:24:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-27 17:24:30 +0000 |
commit | 7946dd363beaa92e8d03ef199ffedaab58714058 (patch) | |
tree | f91d67489bb82011a3311ded5f64ad9cc2d91a65 | |
parent | 5ae962da4dc277f1819a00361d4dcd49dc66bd89 (diff) |
C++ allows empty enum list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41498 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Parse/ParseDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<DeclTy*, 32> EnumConstantDecls; |