aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-02-09 18:23:29 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-02-09 18:23:29 +0000
commitab197baec16bacade82325fb274cf6b992ac5d8a (patch)
tree0381fff06de5af8ef5e30e3e00b95afe957bce01 /lib/Parse/ParseDeclCXX.cpp
parentd3098ee64c069a3eff4d2d0a5d655d968c7b5dd2 (diff)
Implement Declarator::getSourceRange().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--lib/Parse/ParseDeclCXX.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 59c086f813..fe08fc5051 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -630,8 +630,11 @@ Parser::DeclTy *Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS) {
}
// If attributes exist after the declarator, parse them.
- if (Tok.is(tok::kw___attribute))
- DeclaratorInfo.AddAttributes(ParseAttributes());
+ if (Tok.is(tok::kw___attribute)) {
+ SourceLocation Loc;
+ AttributeList *AttrList = ParseAttributes(&Loc);
+ DeclaratorInfo.AddAttributes(AttrList, Loc);
+ }
// NOTE: If Sema is the Action module and declarator is an instance field,
// this call will *not* return the created decl; LastDeclInGroup will be
@@ -691,8 +694,11 @@ Parser::DeclTy *Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS) {
Init = 0;
// Attributes are only allowed on the second declarator.
- if (Tok.is(tok::kw___attribute))
- DeclaratorInfo.AddAttributes(ParseAttributes());
+ if (Tok.is(tok::kw___attribute)) {
+ SourceLocation Loc;
+ AttributeList *AttrList = ParseAttributes(&Loc);
+ DeclaratorInfo.AddAttributes(AttrList, Loc);
+ }
if (Tok.isNot(tok::colon))
ParseDeclarator(DeclaratorInfo);
@@ -921,7 +927,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(DeclTy *ConstructorDecl) {
/// type-id
/// type-id-list ',' type-id
///
-bool Parser::ParseExceptionSpecification() {
+bool Parser::ParseExceptionSpecification(SourceLocation &EndLoc) {
assert(Tok.is(tok::kw_throw) && "expected throw");
SourceLocation ThrowLoc = ConsumeToken();
@@ -937,7 +943,7 @@ bool Parser::ParseExceptionSpecification() {
SourceLocation EllipsisLoc = ConsumeToken();
if (!getLang().Microsoft)
Diag(EllipsisLoc, diag::ext_ellipsis_exception_spec);
- SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ EndLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
return false;
}
@@ -950,6 +956,6 @@ bool Parser::ParseExceptionSpecification() {
break;
}
- SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
+ EndLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
return false;
}