From c1d2d8a0143f6b8466f5c02932d0ad0021e479fc Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 31 Mar 2010 17:34:00 +0000 Subject: [PATCH] Rename TypenameType to DependentNameType in anticipation of some refactoring work in this area. llvm-svn: 100019 --- clang/include/clang/AST/ASTContext.h | 6 ++--- clang/include/clang/AST/Type.h | 24 +++++++++--------- clang/include/clang/AST/TypeLoc.h | 6 ++--- clang/include/clang/AST/TypeNodes.def | 2 +- clang/include/clang/Frontend/TypeXML.def | 2 +- clang/lib/AST/ASTContext.cpp | 32 ++++++++++++------------ clang/lib/AST/ASTImporter.cpp | 8 +++--- clang/lib/AST/Type.cpp | 2 +- clang/lib/AST/TypePrinter.cpp | 2 +- clang/lib/CodeGen/Mangle.cpp | 4 +-- clang/lib/Frontend/PCHReader.cpp | 2 +- clang/lib/Frontend/PCHWriter.cpp | 2 +- clang/lib/Sema/SemaDecl.cpp | 6 ++--- clang/lib/Sema/SemaTemplate.cpp | 22 ++++++++-------- clang/lib/Sema/SemaTemplateDeduction.cpp | 6 ++--- clang/lib/Sema/SemaType.cpp | 2 +- clang/lib/Sema/TreeTransform.h | 20 +++++++-------- 17 files changed, 74 insertions(+), 74 deletions(-) diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 1633dbd311ff..0bf964286335 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -117,7 +117,7 @@ class ASTContext { llvm::FoldingSet SubstTemplateTypeParmTypes; llvm::FoldingSet TemplateSpecializationTypes; llvm::FoldingSet QualifiedNameTypes; - llvm::FoldingSet TypenameTypes; + llvm::FoldingSet DependentNameTypes; llvm::FoldingSet ObjCInterfaceTypes; llvm::FoldingSet ObjCObjectPointerTypes; llvm::FoldingSet ElaboratedTypes; @@ -630,10 +630,10 @@ public: QualType getQualifiedNameType(NestedNameSpecifier *NNS, QualType NamedType); - QualType getTypenameType(NestedNameSpecifier *NNS, + QualType getDependentNameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon = QualType()); - QualType getTypenameType(NestedNameSpecifier *NNS, + QualType getDependentNameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *TemplateId, QualType Canon = QualType()); QualType getElaboratedType(QualType UnderlyingType, diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 85020653dfcc..0eb45a0a4b7f 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -2604,16 +2604,16 @@ public: /// \brief Represents a 'typename' specifier that names a type within /// a dependent type, e.g., "typename T::type". /// -/// TypenameType has a very similar structure to QualifiedNameType, +/// DependentNameType has a very similar structure to QualifiedNameType, /// which also involves a nested-name-specifier following by a type, /// and (FIXME!) both can even be prefixed by the 'typename' /// keyword. However, the two types serve very different roles: /// QualifiedNameType is a non-semantic type that serves only as sugar /// to show how a particular type was written in the source -/// code. TypenameType, on the other hand, only occurs when the +/// code. DependentNameType, on the other hand, only occurs when the /// nested-name-specifier is dependent, such that we cannot resolve /// the actual type until after instantiation. -class TypenameType : public Type, public llvm::FoldingSetNode { +class DependentNameType : public Type, public llvm::FoldingSetNode { /// \brief The nested name specifier containing the qualifier. NestedNameSpecifier *NNS; @@ -2623,18 +2623,18 @@ class TypenameType : public Type, public llvm::FoldingSetNode { /// \brief The type that this typename specifier refers to. NameType Name; - TypenameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name, + DependentNameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType CanonType) - : Type(Typename, CanonType, true), NNS(NNS), Name(Name) { + : Type(DependentName, CanonType, true), NNS(NNS), Name(Name) { assert(NNS->isDependent() && - "TypenameType requires a dependent nested-name-specifier"); + "DependentNameType requires a dependent nested-name-specifier"); } - TypenameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *Ty, + DependentNameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *Ty, QualType CanonType) - : Type(Typename, CanonType, true), NNS(NNS), Name(Ty) { + : Type(DependentName, CanonType, true), NNS(NNS), Name(Ty) { assert(NNS->isDependent() && - "TypenameType requires a dependent nested-name-specifier"); + "DependentNameType requires a dependent nested-name-specifier"); } friend class ASTContext; // ASTContext creates these @@ -2673,9 +2673,9 @@ public: } static bool classof(const Type *T) { - return T->getTypeClass() == Typename; + return T->getTypeClass() == DependentName; } - static bool classof(const TypenameType *T) { return true; } + static bool classof(const DependentNameType *T) { return true; } }; /// ObjCInterfaceType - Interfaces are the core concept in Objective-C for @@ -3260,6 +3260,6 @@ CLANG_ISA_STATISTIC(SubstTemplateTypeParmType, cxx_type_checks) CLANG_ISA_STATISTIC(TemplateSpecializationType, cxx_type_checks) CLANG_ISA_STATISTIC(QualifiedNameType, cxx_type_checks) CLANG_ISA_STATISTIC(InjectedClassNameType, cxx_type_checks) -CLANG_ISA_STATISTIC(TypenameType, cxx_type_checks) +CLANG_ISA_STATISTIC(DependentNameType, cxx_type_checks) #endif diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 27659bd02f97..a51da7474d37 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -1242,9 +1242,9 @@ class QualifiedNameTypeLoc : }; // FIXME: locations for the typename keyword and nested name specifier. -class TypenameTypeLoc : public InheritingConcreteTypeLoc { +class DependentNameTypeLoc : public InheritingConcreteTypeLoc { }; } diff --git a/clang/include/clang/AST/TypeNodes.def b/clang/include/clang/AST/TypeNodes.def index e75202e50abf..7e8b73c7a5f9 100644 --- a/clang/include/clang/AST/TypeNodes.def +++ b/clang/include/clang/AST/TypeNodes.def @@ -92,7 +92,7 @@ NON_CANONICAL_TYPE(SubstTemplateTypeParm, Type) NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TemplateSpecialization, Type) NON_CANONICAL_TYPE(QualifiedName, Type) NON_CANONICAL_TYPE(InjectedClassName, Type) -DEPENDENT_TYPE(Typename, Type) +DEPENDENT_TYPE(DependentName, Type) TYPE(ObjCInterface, Type) TYPE(ObjCObjectPointer, Type) diff --git a/clang/include/clang/Frontend/TypeXML.def b/clang/include/clang/Frontend/TypeXML.def index dd5018af82aa..3add99a941c4 100644 --- a/clang/include/clang/Frontend/TypeXML.def +++ b/clang/include/clang/Frontend/TypeXML.def @@ -233,7 +233,7 @@ NODE_XML(QualifiedNameType, "QualifiedNameType") TYPE_ATTRIBUTE_XML(getNamedType()) END_NODE_XML -NODE_XML(TypenameType, "TypenameType") +NODE_XML(DependentNameType, "DependentNameType") ID_ATTRIBUTE_XML END_NODE_XML diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 2b88a6cd9f2c..7fce55b9dfda 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1962,7 +1962,7 @@ ASTContext::getQualifiedNameType(NestedNameSpecifier *NNS, return QualType(T, 0); } -QualType ASTContext::getTypenameType(NestedNameSpecifier *NNS, +QualType ASTContext::getDependentNameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name, QualType Canon) { assert(NNS->isDependent() && "nested-name-specifier must be dependent"); @@ -1970,36 +1970,36 @@ QualType ASTContext::getTypenameType(NestedNameSpecifier *NNS, if (Canon.isNull()) { NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS); if (CanonNNS != NNS) - Canon = getTypenameType(CanonNNS, Name); + Canon = getDependentNameType(CanonNNS, Name); } llvm::FoldingSetNodeID ID; - TypenameType::Profile(ID, NNS, Name); + DependentNameType::Profile(ID, NNS, Name); void *InsertPos = 0; - TypenameType *T - = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos); + DependentNameType *T + = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos); if (T) return QualType(T, 0); - T = new (*this) TypenameType(NNS, Name, Canon); + T = new (*this) DependentNameType(NNS, Name, Canon); Types.push_back(T); - TypenameTypes.InsertNode(T, InsertPos); + DependentNameTypes.InsertNode(T, InsertPos); return QualType(T, 0); } QualType -ASTContext::getTypenameType(NestedNameSpecifier *NNS, +ASTContext::getDependentNameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *TemplateId, QualType Canon) { assert(NNS->isDependent() && "nested-name-specifier must be dependent"); llvm::FoldingSetNodeID ID; - TypenameType::Profile(ID, NNS, TemplateId); + DependentNameType::Profile(ID, NNS, TemplateId); void *InsertPos = 0; - TypenameType *T - = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos); + DependentNameType *T + = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos); if (T) return QualType(T, 0); @@ -2011,17 +2011,17 @@ ASTContext::getTypenameType(NestedNameSpecifier *NNS, = CanonType->getAs(); assert(CanonTemplateId && "Canonical type must also be a template specialization type"); - Canon = getTypenameType(CanonNNS, CanonTemplateId); + Canon = getDependentNameType(CanonNNS, CanonTemplateId); } - TypenameType *CheckT - = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos); + DependentNameType *CheckT + = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos); assert(!CheckT && "Typename canonical type is broken"); (void)CheckT; } - T = new (*this) TypenameType(NNS, TemplateId, Canon); + T = new (*this) DependentNameType(NNS, TemplateId, Canon); Types.push_back(T); - TypenameTypes.InsertNode(T, InsertPos); + DependentNameTypes.InsertNode(T, InsertPos); return QualType(T, 0); } diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 9e789bb554b9..75cf1380a112 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -73,7 +73,7 @@ namespace { // FIXME: SubstTemplateTypeParmType // FIXME: TemplateSpecializationType QualType VisitQualifiedNameType(QualifiedNameType *T); - // FIXME: TypenameType + // FIXME: DependentNameType QualType VisitObjCInterfaceType(ObjCInterfaceType *T); QualType VisitObjCObjectPointerType(ObjCObjectPointerType *T); @@ -618,9 +618,9 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, break; } - case Type::Typename: { - const TypenameType *Typename1 = cast(T1); - const TypenameType *Typename2 = cast(T2); + case Type::DependentName: { + const DependentNameType *Typename1 = cast(T1); + const DependentNameType *Typename2 = cast(T2); if (!IsStructurallyEquivalent(Context, Typename1->getQualifier(), Typename2->getQualifier())) diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 4e24de19227e..a18cd0fbca83 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -757,7 +757,7 @@ bool Type::isSpecifierType() const { case SubstTemplateTypeParm: case TemplateSpecialization: case QualifiedName: - case Typename: + case DependentName: case ObjCInterface: case ObjCObjectPointer: case Elaborated: diff --git a/clang/lib/AST/TypePrinter.cpp b/clang/lib/AST/TypePrinter.cpp index 85e23d60baa8..da0ac3f5ae9a 100644 --- a/clang/lib/AST/TypePrinter.cpp +++ b/clang/lib/AST/TypePrinter.cpp @@ -567,7 +567,7 @@ void TypePrinter::PrintQualifiedName(const QualifiedNameType *T, S = MyString + ' ' + S; } -void TypePrinter::PrintTypename(const TypenameType *T, std::string &S) { +void TypePrinter::PrintDependentName(const DependentNameType *T, std::string &S) { std::string MyString; { diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 9fdb12e15e12..af5e5d3c783c 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -1164,7 +1164,7 @@ void CXXNameMangler::mangleType(const TemplateSpecializationType *T) { mangleName(TD, T->getArgs(), T->getNumArgs()); } -void CXXNameMangler::mangleType(const TypenameType *T) { +void CXXNameMangler::mangleType(const DependentNameType *T) { // Typename types are always nested Out << 'N'; mangleUnresolvedScope(T->getQualifier()); @@ -1456,7 +1456,7 @@ void CXXNameMangler::mangleExpression(const Expr *E) { // It isn't clear that we ever actually want to have such a // nested-name-specifier; why not just represent it as a typename type? if (!QTy && NNS->getAsIdentifier() && NNS->getPrefix()) { - QTy = getASTContext().getTypenameType(NNS->getPrefix(), + QTy = getASTContext().getDependentNameType(NNS->getPrefix(), NNS->getAsIdentifier()) .getTypePtr(); } diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 579f827e16b8..6d39952e9d27 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -2351,7 +2351,7 @@ void TypeLocReader::VisitQualifiedNameTypeLoc(QualifiedNameTypeLoc TL) { void TypeLocReader::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) { TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } -void TypeLocReader::VisitTypenameTypeLoc(TypenameTypeLoc TL) { +void TypeLocReader::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) { TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++])); } void TypeLocReader::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 5086b488f6d3..4dd8dc36b760 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/lib/Frontend/PCHWriter.cpp @@ -406,7 +406,7 @@ void TypeLocWriter::VisitQualifiedNameTypeLoc(QualifiedNameTypeLoc TL) { void TypeLocWriter::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } -void TypeLocWriter::VisitTypenameTypeLoc(TypenameTypeLoc TL) { +void TypeLocWriter::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) { Writer.AddSourceLocation(TL.getNameLoc(), Record); } void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) { diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index b8158bb7a095..4aa16c7d358b 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -88,8 +88,8 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, return 0; // We know from the grammar that this name refers to a type, so build a - // TypenameType node to describe the type. - // FIXME: Record somewhere that this TypenameType node has no "typename" + // DependentNameType node to describe the type. + // FIXME: Record somewhere that this DependentNameType node has no "typename" // keyword associated with it. return CheckTypenameType((NestedNameSpecifier *)SS->getScopeRep(), II, SS->getRange()).getAsOpaquePtr(); @@ -198,7 +198,7 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc, } else if (UnresolvedUsingTypenameDecl *UUDecl = dyn_cast(IIDecl)) { // FIXME: preserve source structure information. - T = Context.getTypenameType(UUDecl->getTargetNestedNameSpecifier(), &II); + T = Context.getDependentNameType(UUDecl->getTargetNestedNameSpecifier(), &II); } else { // If it's not plausibly a type, suppress diagnostics. Result.suppressDiagnostics(); diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 4507e648684b..2e64a6c332bd 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -4962,7 +4962,7 @@ Sema::ActOnTypenameType(SourceLocation TypenameLoc, const CXXScopeSpec &SS, return Context.getQualifiedNameType(NNS, T).getAsOpaquePtr(); } - return Context.getTypenameType(NNS, TemplateId).getAsOpaquePtr(); + return Context.getDependentNameType(NNS, TemplateId).getAsOpaquePtr(); } /// \brief Build the type that describes a C++ typename specifier, @@ -4977,7 +4977,7 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II, // If the nested-name-specifier does not refer to the current // instantiation, then build a typename type. if (!CurrentInstantiation) - return Context.getTypenameType(NNS, &II); + return Context.getDependentNameType(NNS, &II); // The nested-name-specifier refers to the current instantiation, so the // "typename" keyword itself is superfluous. In C++03, the program is @@ -5013,7 +5013,7 @@ Sema::CheckTypenameType(NestedNameSpecifier *NNS, const IdentifierInfo &II, case LookupResult::NotFoundInCurrentInstantiation: // Okay, it's a member of an unknown instantiation. - return Context.getTypenameType(NNS, &II); + return Context.getDependentNameType(NNS, &II); case LookupResult::Found: if (TypeDecl *Type = dyn_cast(Result.getFoundDecl())) { @@ -5098,16 +5098,16 @@ namespace { /// \brief Transforms a typename type by determining whether the type now /// refers to a member of the current instantiation, and then /// type-checking and building a QualifiedNameType (when possible). - QualType TransformTypenameType(TypeLocBuilder &TLB, TypenameTypeLoc TL, + QualType TransformDependentNameType(TypeLocBuilder &TLB, DependentNameTypeLoc TL, QualType ObjectType); }; } QualType -CurrentInstantiationRebuilder::TransformTypenameType(TypeLocBuilder &TLB, - TypenameTypeLoc TL, +CurrentInstantiationRebuilder::TransformDependentNameType(TypeLocBuilder &TLB, + DependentNameTypeLoc TL, QualType ObjectType) { - TypenameType *T = TL.getTypePtr(); + DependentNameType *T = TL.getTypePtr(); NestedNameSpecifier *NNS = TransformNestedNameSpecifier(T->getQualifier(), @@ -5139,15 +5139,15 @@ CurrentInstantiationRebuilder::TransformTypenameType(TypeLocBuilder &TLB, NewTemplateId == QualType(TemplateId, 0)) Result = QualType(T, 0); else - Result = getDerived().RebuildTypenameType(NNS, NewTemplateId); + Result = getDerived().RebuildDependentNameType(NNS, NewTemplateId); } else - Result = getDerived().RebuildTypenameType(NNS, T->getIdentifier(), + Result = getDerived().RebuildDependentNameType(NNS, T->getIdentifier(), SourceRange(TL.getNameLoc())); if (Result.isNull()) return QualType(); - TypenameTypeLoc NewTL = TLB.push(Result); + DependentNameTypeLoc NewTL = TLB.push(Result); NewTL.setNameLoc(TL.getNameLoc()); return Result; } @@ -5172,7 +5172,7 @@ CurrentInstantiationRebuilder::TransformTypenameType(TypeLocBuilder &TLB, /// typename X::pointer X::data() { ... } /// \endcode /// -/// Here, the type "typename X::pointer" will be created as a TypenameType, +/// Here, the type "typename X::pointer" will be created as a DependentNameType, /// since we do not know that we can look into X when we parsed the type. /// This function will rebuild the type, performing the lookup of "pointer" /// in X and returning a QualifiedNameType whose canonical type is the same diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp index 31a642fd054d..d61a767dc5fe 100644 --- a/clang/lib/Sema/SemaTemplateDeduction.cpp +++ b/clang/lib/Sema/SemaTemplateDeduction.cpp @@ -773,7 +773,7 @@ DeduceTemplateArguments(Sema &S, case Type::TypeOfExpr: case Type::TypeOf: - case Type::Typename: + case Type::DependentName: // No template argument deduction for these types return Sema::TDK_Success; @@ -2555,10 +2555,10 @@ MarkUsedTemplateParameters(Sema &SemaRef, QualType T, OnlyDeduced, Depth, Used); break; - case Type::Typename: + case Type::DependentName: if (!OnlyDeduced) MarkUsedTemplateParameters(SemaRef, - cast(T)->getQualifier(), + cast(T)->getQualifier(), OnlyDeduced, Depth, Used); break; diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 2c6cc7fc9d1d..cc6b7a821966 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -1262,7 +1262,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, NestedNameSpecifier *NNSPrefix = NNS->getPrefix(); switch (NNS->getKind()) { case NestedNameSpecifier::Identifier: - ClsType = Context.getTypenameType(NNSPrefix, NNS->getAsIdentifier()); + ClsType = Context.getDependentNameType(NNSPrefix, NNS->getAsIdentifier()); break; case NestedNameSpecifier::Namespace: diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index c7ea17fde68c..5d3f21e4e8c1 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -537,15 +537,15 @@ public: /// \brief Build a new typename type that refers to a template-id. /// - /// By default, builds a new TypenameType type from the nested-name-specifier + /// By default, builds a new DependentNameType type from the nested-name-specifier /// and the given type. Subclasses may override this routine to provide /// different behavior. - QualType RebuildTypenameType(NestedNameSpecifier *NNS, QualType T) { + QualType RebuildDependentNameType(NestedNameSpecifier *NNS, QualType T) { if (NNS->isDependent()) { CXXScopeSpec SS; SS.setScopeRep(NNS); if (!SemaRef.computeDeclContext(SS)) - return SemaRef.Context.getTypenameType(NNS, + return SemaRef.Context.getDependentNameType(NNS, cast(T)); } @@ -557,7 +557,7 @@ public: /// By default, performs semantic analysis when building the typename type /// (or qualified name type). Subclasses may override this routine to provide /// different behavior. - QualType RebuildTypenameType(NestedNameSpecifier *NNS, + QualType RebuildDependentNameType(NestedNameSpecifier *NNS, const IdentifierInfo *Id, SourceRange SR) { return SemaRef.CheckTypenameType(NNS, *Id, SR); @@ -2996,10 +2996,10 @@ TreeTransform::TransformQualifiedNameType(TypeLocBuilder &TLB, } template -QualType TreeTransform::TransformTypenameType(TypeLocBuilder &TLB, - TypenameTypeLoc TL, +QualType TreeTransform::TransformDependentNameType(TypeLocBuilder &TLB, + DependentNameTypeLoc TL, QualType ObjectType) { - TypenameType *T = TL.getTypePtr(); + DependentNameType *T = TL.getTypePtr(); /* FIXME: preserve source information better than this */ SourceRange SR(TL.getNameLoc()); @@ -3023,14 +3023,14 @@ QualType TreeTransform::TransformTypenameType(TypeLocBuilder &TLB, NewTemplateId == QualType(TemplateId, 0)) return QualType(T, 0); - Result = getDerived().RebuildTypenameType(NNS, NewTemplateId); + Result = getDerived().RebuildDependentNameType(NNS, NewTemplateId); } else { - Result = getDerived().RebuildTypenameType(NNS, T->getIdentifier(), SR); + Result = getDerived().RebuildDependentNameType(NNS, T->getIdentifier(), SR); } if (Result.isNull()) return QualType(); - TypenameTypeLoc NewTL = TLB.push(Result); + DependentNameTypeLoc NewTL = TLB.push(Result); NewTL.setNameLoc(TL.getNameLoc()); return Result;