summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index c472972e5cb..333d72a754c 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -196,12 +196,20 @@ Parser::ParseSingleDeclarationAfterTemplate(
return 0;
}
+ CXX0XAttributeList PrefixAttrs;
+ if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier())
+ PrefixAttrs = ParseCXX0XAttributes();
+
+ if (Tok.is(tok::kw_using))
+ return ParseUsingDirectiveOrDeclaration(Context, TemplateInfo, DeclEnd,
+ PrefixAttrs);
+
// Parse the declaration specifiers, stealing the accumulated
// diagnostics from the template parameters.
ParsingDeclSpec DS(DiagsFromTParams);
- if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier())
- DS.AddAttributes(ParseCXX0XAttributes().AttrList);
+ if (PrefixAttrs.HasAttr)
+ DS.AddAttributes(PrefixAttrs.AttrList);
ParseDeclarationSpecifiers(DS, TemplateInfo, AS,
getDeclSpecContextFromDeclaratorContext(Context));
@@ -1075,3 +1083,14 @@ Decl *Parser::ParseExplicitInstantiation(SourceLocation ExternLoc,
ParsingTemplateParams,
DeclEnd, AS_none);
}
+
+SourceRange Parser::ParsedTemplateInfo::getSourceRange() const {
+ if (TemplateParams)
+ return getTemplateParamsRange(TemplateParams->data(),
+ TemplateParams->size());
+
+ SourceRange R(TemplateLoc);
+ if (ExternLoc.isValid())
+ R.setBegin(ExternLoc);
+ return R;
+}
OpenPOWER on IntegriCloud