aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-07-10 19:20:26 +0000
committerAnders Carlsson <andersca@mac.com>2009-07-10 19:20:26 +0000
commit563a03b1338d31c2462def43253a722bc885d384 (patch)
tree0de700b6b1a11f69e804f33de53498360a04c06e /lib/AST/Type.cpp
parenteeea45611d45238c34474c183cee96d47ae79e24 (diff)
Fix a problem that Eli noticed, and that Doug helped me fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index d5dd776b7d..78c3b78977 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -124,8 +124,10 @@ QualType Type::getDesugaredType(bool ForDisplay) const {
return TOE->getUnderlyingExpr()->getType().getDesugaredType();
if (const TypeOfType *TOT = dyn_cast<TypeOfType>(this))
return TOT->getUnderlyingType().getDesugaredType();
- if (const DecltypeType *DTT = dyn_cast<DecltypeType>(this))
- return DTT->getCanonicalTypeInternal();
+ if (const DecltypeType *DTT = dyn_cast<DecltypeType>(this)) {
+ if (!DTT->getUnderlyingType()->isDependentType())
+ return DTT->getUnderlyingType().getDesugaredType();
+ }
if (const TemplateSpecializationType *Spec
= dyn_cast<TemplateSpecializationType>(this)) {
if (ForDisplay)
@@ -1074,8 +1076,9 @@ TypeOfExprType::TypeOfExprType(Expr *E, QualType can)
: Type(TypeOfExpr, can, E->isTypeDependent()), TOExpr(E) {
}
-DecltypeType::DecltypeType(Expr *E, QualType can)
- : Type(Decltype, can, E->isTypeDependent()), E(E) {
+DecltypeType::DecltypeType(Expr *E, QualType underlyingType, QualType can)
+ : Type(Decltype, can, E->isTypeDependent()), E(E),
+ UnderlyingType(underlyingType) {
}
TagType::TagType(TypeClass TC, TagDecl *D, QualType can)