diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-06 15:48:19 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-06 15:48:19 +0000 |
commit | 344577e6b58f42d18dc8118c8903b49a85dc005e (patch) | |
tree | efe06d72a51645984be3a25393915031a52f2e47 /lib/AST/DeclTemplate.cpp | |
parent | 8b5b4099c61a136e9a1714c4d8a593febe942268 (diff) |
Fixed TypedefDecl and TemplateTypeParameter source range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclTemplate.cpp')
-rw-r--r-- | lib/AST/DeclTemplate.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp index fe7c9e2904..78782bc5c7 100644 --- a/lib/AST/DeclTemplate.cpp +++ b/lib/AST/DeclTemplate.cpp @@ -415,17 +415,18 @@ ClassTemplateDecl::getInjectedClassNameSpecialization() { TemplateTypeParmDecl * TemplateTypeParmDecl::Create(const ASTContext &C, DeclContext *DC, - SourceLocation L, unsigned D, unsigned P, - IdentifierInfo *Id, bool Typename, - bool ParameterPack) { + SourceLocation KeyLoc, SourceLocation NameLoc, + unsigned D, unsigned P, IdentifierInfo *Id, + bool Typename, bool ParameterPack) { QualType Type = C.getTemplateTypeParmType(D, P, ParameterPack, Id); - return new (C) TemplateTypeParmDecl(DC, L, Id, Typename, Type, ParameterPack); + return new (C) TemplateTypeParmDecl(DC, KeyLoc, NameLoc, Id, Typename, + Type, ParameterPack); } TemplateTypeParmDecl * TemplateTypeParmDecl::Create(const ASTContext &C, EmptyShell Empty) { - return new (C) TemplateTypeParmDecl(0, SourceLocation(), 0, false, - QualType(), false); + return new (C) TemplateTypeParmDecl(0, SourceLocation(), SourceLocation(), + 0, false, QualType(), false); } SourceLocation TemplateTypeParmDecl::getDefaultArgumentLoc() const { @@ -436,10 +437,10 @@ SourceLocation TemplateTypeParmDecl::getDefaultArgumentLoc() const { SourceRange TemplateTypeParmDecl::getSourceRange() const { if (hasDefaultArgument() && !defaultArgumentWasInherited()) - return SourceRange(getLocation(), + return SourceRange(getLocStart(), DefaultArgument->getTypeLoc().getEndLoc()); else - return SourceRange(getLocation()); + return TypeDecl::getSourceRange(); } unsigned TemplateTypeParmDecl::getDepth() const { |