aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-10 10:18:27 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2011-03-10 10:18:27 +0000
commit91ce2c4484e56cdc8068cebaaf2bb42362b0e1a6 (patch)
treea30a6cfdc328d757510b2a114d14b4c361d880be /lib/Sema/SemaType.cpp
parent0d28d360b5559abda755e50b855ba5e59727d9cd (diff)
Fixed class type generation for MemberPointerType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp11
1 files changed, 6 insertions, 5 deletions
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<TemplateSpecializationType>(NNS->getAsType()))
ClsType = Context.getElaboratedType(ETK_None, NNSPrefix, ClsType);
break;
}