summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-11-04 19:04:38 +0000
committerJohn McCall <rjmccall@apple.com>2010-11-04 19:04:38 +0000
commit954b5de0d816046962813ef8052eea3b636b7441 (patch)
tree2c604a45b3f7475b0d4ee6ed15fcda4e33522935 /clang/lib/Sema/SemaTemplateInstantiate.cpp
parented8b7bf9edf309ad34465b9b8a59dbc54ef7f360 (diff)
downloadbcm5719-llvm-954b5de0d816046962813ef8052eea3b636b7441.tar.gz
bcm5719-llvm-954b5de0d816046962813ef8052eea3b636b7441.zip
Use the real keyword location when rebuilding an elaborated type instead of
making something up. Fixes PR8129. llvm-svn: 118258
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index f78fe81aa8b..af9af0ab83a 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud