Tweaks to C++0x deduced auto type support:
 * Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
 * Temporary template parameter list for auto deduction is now allocated on the stack.
 * Deduced 'auto' types are now uniqued.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126139 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index bd0a618..139fafb 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -3004,12 +3004,12 @@
   LocalInstantiationScope InstScope(*this);
 
   // Build template<class TemplParam> void Func(FuncParam);
-  NamedDecl *TemplParam
-    = TemplateTypeParmDecl::Create(Context, 0, Loc, 0, 0, 0, false, false);
-  TemplateParameterList *TemplateParams
-    = TemplateParameterList::Create(Context, Loc, Loc, &TemplParam, 1, Loc);
-
   QualType TemplArg = Context.getTemplateTypeParmType(0, 0, false);
+  TemplateTypeParmDecl TemplParam(0, Loc, 0, false, TemplArg, false);
+  NamedDecl *TemplParamPtr = &TemplParam;
+  FixedSizeTemplateParameterList<1> TemplateParams(Loc, Loc, &TemplParamPtr,
+                                                   Loc);
+
   QualType FuncParam =
     SubstituteAutoTransform(*this, TemplArg).TransformType(Type);
 
@@ -3018,13 +3018,13 @@
   Deduced.resize(1);
   QualType InitType = Init->getType();
   unsigned TDF = 0;
-  if (AdjustFunctionParmAndArgTypesForDeduction(*this, TemplateParams,
+  if (AdjustFunctionParmAndArgTypesForDeduction(*this, &TemplateParams,
                                                 FuncParam, InitType, Init,
                                                 TDF))
     return false;
 
   TemplateDeductionInfo Info(Context, Loc);
-  if (::DeduceTemplateArguments(*this, TemplateParams,
+  if (::DeduceTemplateArguments(*this, &TemplateParams,
                                 FuncParam, InitType, Info, Deduced,
                                 TDF))
     return false;