diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-30 13:56:41 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-30 13:56:41 +0000 |
commit | dc7a4f5d7a7e3b60d4dc4a80338d7a2728540998 (patch) | |
tree | 0fdbc7f2427ae39e5c561332fb0d7c04e4dcb65b /lib/Sema/TreeTransform.h | |
parent | 24cb36d9c212f82b3d9aedd34be27ae4911bfdba (diff) |
Don't treat a non-deduced 'auto' type as being type-dependent. Instead, there
are now two distinct canonical 'AutoType's: one is the undeduced 'auto'
placeholder type, and the other is a deduced-but-dependent type. All
deduced-to-a-non-dependent-type cases are still non-canonical.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r-- | lib/Sema/TreeTransform.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index c0bc34fa97..925860a600 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -764,6 +764,9 @@ public: /// /// By default, builds a new AutoType with the given deduced type. QualType RebuildAutoType(QualType Deduced, bool IsDecltypeAuto) { + // Note, IsDependent is always false here: we implicitly convert an 'auto' + // which has been deduced to a dependent type into an undeduced 'auto', so + // that we'll retry deduction after the transformation. return SemaRef.Context.getAutoType(Deduced, IsDecltypeAuto); } @@ -4500,7 +4503,8 @@ QualType TreeTransform<Derived>::TransformAutoType(TypeLocBuilder &TLB, } QualType Result = TL.getType(); - if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced) { + if (getDerived().AlwaysRebuild() || NewDeduced != OldDeduced || + T->isDependentType()) { Result = getDerived().RebuildAutoType(NewDeduced, T->isDecltypeAuto()); if (Result.isNull()) return QualType(); |