aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index eda490d918..9cf025df5e 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -1373,7 +1373,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// declarator pure-specifier[opt]
// declarator constant-initializer[opt]
// identifier[opt] ':' constant-expression
-
if (Tok.is(tok::colon)) {
ConsumeToken();
BitfieldSize = ParseConstantExpression();
@@ -1390,7 +1389,6 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
// defaulted/deleted function-definition:
// '=' 'default' [TODO]
// '=' 'delete'
-
if (Tok.is(tok::equal)) {
ConsumeToken();
if (getLang().CPlusPlus0x && Tok.is(tok::kw_delete)) {
@@ -1403,6 +1401,17 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
}
}
+ // If a simple-asm-expr is present, parse it.
+ if (Tok.is(tok::kw_asm)) {
+ SourceLocation Loc;
+ OwningExprResult AsmLabel(ParseSimpleAsm(&Loc));
+ if (AsmLabel.isInvalid())
+ SkipUntil(tok::comma, true, true);
+
+ DeclaratorInfo.setAsmLabel(AsmLabel.release());
+ DeclaratorInfo.SetRangeEnd(Loc);
+ }
+
// If attributes exist after the declarator, parse them.
if (Tok.is(tok::kw___attribute)) {
SourceLocation Loc;