diff options
author | John McCall <rjmccall@apple.com> | 2010-11-04 19:04:38 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-04 19:04:38 +0000 |
commit | 21e413fe6305a198564d436ac515497716c47844 (patch) | |
tree | 16c83e7fbbb9cbd1b1d6f9a903caadf9e436cb43 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | c9d557301cc910d0562876e6a7b4595e3d2fb846 (diff) |
Use the real keyword location when rebuilding an elaborated type instead of
making something up. Fixes PR8129.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118258 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index f78fe81aa8..af9af0ab83 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -618,7 +618,8 @@ namespace { /// \brief Check for tag mismatches when instantiating an /// elaborated type. - QualType RebuildElaboratedType(ElaboratedTypeKeyword Keyword, + QualType RebuildElaboratedType(SourceLocation KeywordLoc, + ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType T); ExprResult TransformPredefinedExpr(PredefinedExpr *E); @@ -743,14 +744,14 @@ VarDecl *TemplateInstantiator::RebuildObjCExceptionDecl(VarDecl *ExceptionDecl, } QualType -TemplateInstantiator::RebuildElaboratedType(ElaboratedTypeKeyword Keyword, +TemplateInstantiator::RebuildElaboratedType(SourceLocation KeywordLoc, + ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, QualType T) { if (const TagType *TT = T->getAs<TagType>()) { TagDecl* TD = TT->getDecl(); - // FIXME: this location is very wrong; we really need typelocs. - SourceLocation TagLocation = TD->getTagKeywordLoc(); + SourceLocation TagLocation = KeywordLoc; // FIXME: type might be anonymous. IdentifierInfo *Id = TD->getIdentifier(); @@ -769,7 +770,8 @@ TemplateInstantiator::RebuildElaboratedType(ElaboratedTypeKeyword Keyword, } } - return TreeTransform<TemplateInstantiator>::RebuildElaboratedType(Keyword, + return TreeTransform<TemplateInstantiator>::RebuildElaboratedType(KeywordLoc, + Keyword, NNS, T); } |