[cfe-commits] r113446 - /cfe/trunk/lib/Sema/TreeTransform.h
Douglas Gregor
dgregor at apple.com
Wed Sep 8 16:56:00 PDT 2010
Author: dgregor
Date: Wed Sep 8 18:56:00 2010
New Revision: 113446
URL: http://llvm.org/viewvc/llvm-project?rev=113446&view=rev
Log:
Push the range associated with a nested-name-specifier further through
TreeTransform, since we were getting an empty source range where we
shouldn't. Sadly, the test case is Boost.Proto, and isn't worth
reducing.
Modified:
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=113446&r1=113445&r2=113446&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Sep 8 18:56:00 2010
@@ -534,14 +534,16 @@
/// this routine to provide different behavior.
QualType RebuildDependentTemplateSpecializationType(
ElaboratedTypeKeyword Keyword,
- NestedNameSpecifier *NNS,
+ NestedNameSpecifier *Qualifier,
+ SourceRange QualifierRange,
const IdentifierInfo *Name,
SourceLocation NameLoc,
const TemplateArgumentListInfo &Args) {
// Rebuild the template name.
// TODO: avoid TemplateName abstraction
TemplateName InstName =
- getDerived().RebuildTemplateName(NNS, *Name, QualType());
+ getDerived().RebuildTemplateName(Qualifier, QualifierRange, *Name,
+ QualType());
if (InstName.isNull())
return QualType();
@@ -549,7 +551,7 @@
// If it's still dependent, make a dependent specialization.
if (InstName.getAsDependentTemplateName())
return SemaRef.Context.getDependentTemplateSpecializationType(
- Keyword, NNS, Name, Args);
+ Keyword, Qualifier, Name, Args);
// Otherwise, make an elaborated type wrapping a non-dependent
// specialization.
@@ -689,6 +691,7 @@
/// template name. Subclasses may override this routine to provide different
/// behavior.
TemplateName RebuildTemplateName(NestedNameSpecifier *Qualifier,
+ SourceRange QualifierRange,
const IdentifierInfo &II,
QualType ObjectType);
@@ -2185,9 +2188,13 @@
ObjectType.isNull())
return Name;
- if (DTN->isIdentifier())
- return getDerived().RebuildTemplateName(NNS, *DTN->getIdentifier(),
+ if (DTN->isIdentifier()) {
+ // FIXME: Bad range
+ SourceRange QualifierRange(getDerived().getBaseLocation());
+ return getDerived().RebuildTemplateName(NNS, QualifierRange,
+ *DTN->getIdentifier(),
ObjectType);
+ }
return getDerived().RebuildTemplateName(NNS, DTN->getOperator(),
ObjectType);
@@ -3375,12 +3382,13 @@
NewTemplateArgs.addArgument(Loc);
}
- QualType Result = getDerived().RebuildDependentTemplateSpecializationType(
- T->getKeyword(),
- NNS,
- T->getIdentifier(),
- TL.getNameLoc(),
- NewTemplateArgs);
+ QualType Result
+ = getDerived().RebuildDependentTemplateSpecializationType(T->getKeyword(),
+ NNS,
+ TL.getQualifierRange(),
+ T->getIdentifier(),
+ TL.getNameLoc(),
+ NewTemplateArgs);
if (Result.isNull())
return QualType();
@@ -6578,10 +6586,11 @@
template<typename Derived>
TemplateName
TreeTransform<Derived>::RebuildTemplateName(NestedNameSpecifier *Qualifier,
+ SourceRange QualifierRange,
const IdentifierInfo &II,
QualType ObjectType) {
CXXScopeSpec SS;
- SS.setRange(SourceRange(getDerived().getBaseLocation()));
+ SS.setRange(QualifierRange);
SS.setScopeRep(Qualifier);
UnqualifiedId Name;
Name.setIdentifier(&II, /*FIXME:*/getDerived().getBaseLocation());
More information about the cfe-commits
mailing list