aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 6922dcc6c0..a4117b2bdf 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -94,8 +94,12 @@ QualType Type::getDesugaredType() const {
if (const TypeOfType *TOT = dyn_cast<TypeOfType>(this))
return TOT->getUnderlyingType().getDesugaredType();
if (const TemplateSpecializationType *Spec
- = dyn_cast<TemplateSpecializationType>(this))
- return Spec->getCanonicalTypeInternal().getDesugaredType();
+ = dyn_cast<TemplateSpecializationType>(this)) {
+ QualType Canon = Spec->getCanonicalTypeInternal();
+ if (Canon->getAsTemplateSpecializationType())
+ return QualType(this, 0);
+ return Canon->getDesugaredType();
+ }
if (const QualifiedNameType *QualName = dyn_cast<QualifiedNameType>(this))
return QualName->getNamedType().getDesugaredType();