aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-03 18:54:17 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2010-12-03 18:54:17 +0000
commita88cefd266c428be33cc06f7e8b00ff8fc97c1ff (patch)
treebbddfc32a720cd0f85cfc81cf40a12485c63f5f4 /lib/Parse/ParseDecl.cpp
parent4740dabd14c8660d641228d75ed91bf7e6753b77 (diff)
Added struct/class syntactic info for c++0x scoped enum.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120828 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index f1fb7b29a1..9a682b064d 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1980,11 +1980,13 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
}
bool IsScopedEnum = false;
+ bool IsScopedUsingClassTag = false;
- if (getLang().CPlusPlus0x && (Tok.is(tok::kw_class)
- || Tok.is(tok::kw_struct))) {
- ConsumeToken();
+ if (getLang().CPlusPlus0x &&
+ (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct))) {
IsScopedEnum = true;
+ IsScopedUsingClassTag = Tok.is(tok::kw_class);
+ ConsumeToken();
}
// Must have either 'enum name' or 'enum {...}'.
@@ -2009,6 +2011,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
// declaration of a scoped enumeration.
Diag(Tok, diag::err_scoped_enum_missing_identifier);
IsScopedEnum = false;
+ IsScopedUsingClassTag = false;
}
TypeResult BaseType;
@@ -2103,7 +2106,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
AS,
MultiTemplateParamsArg(Actions),
Owned, IsDependent, IsScopedEnum,
- BaseType);
+ IsScopedUsingClassTag, BaseType);
if (IsDependent) {
// This enum has a dependent nested-name-specifier. Handle it as a