[cfe-commits] r41498 - /cfe/trunk/Parse/ParseDecl.cpp
Chris Lattner
sabre at nondot.org
Mon Aug 27 10:24:30 PDT 2007
Author: lattner
Date: Mon Aug 27 12:24:30 2007
New Revision: 41498
URL: http://llvm.org/viewvc/llvm-project?rev=41498&view=rev
Log:
C++ allows empty enum list.
Modified:
cfe/trunk/Parse/ParseDecl.cpp
Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=41498&r1=41497&r2=41498&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Mon Aug 27 12:24:30 2007
@@ -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;
More information about the cfe-commits
mailing list