From: Abramo Bagnara Date: Thu, 10 Mar 2011 10:18:27 +0000 (+0000) Subject: Fixed class type generation for MemberPointerType. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91ce2c4484e56cdc8068cebaaf2bb42362b0e1a6;p=clang Fixed class type generation for MemberPointerType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127401 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 8e857f1a67..f161f4e623 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1935,11 +1935,12 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: ClsType = QualType(NNS->getAsType(), 0); - // Note: if NNS is dependent, then its prefix (if any) is already - // included in ClsType; this does not hold if the NNS is - // nondependent: in this case (if there is indeed a prefix) - // ClsType needs to be wrapped into an elaborated type. - if (NNSPrefix && !NNS->isDependent()) + // Note: if the NNS has a prefix and ClsType is a nondependent + // TemplateSpecializationType, then the NNS prefix is NOT included + // in ClsType; hence we wrap ClsType into an ElaboratedType. + // NOTE: in particular, no wrap occurs if ClsType already is an + // Elaborated, DependentName, or DependentTemplateSpecialization. + if (NNSPrefix && isa(NNS->getAsType())) ClsType = Context.getElaboratedType(ETK_None, NNSPrefix, ClsType); break; }