Improve the representation of template type parameters. We now
canonicalize by template parameter depth, index, and name, and the
unnamed version of a template parameter serves as the canonical.

TemplateTypeParmDecl no longer needs to inherit from
TemplateParmPosition, since depth and index information is present
within the type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63899 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index 08cd5b3..3949395 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -78,7 +78,8 @@
 TemplateTypeParmDecl::Create(ASTContext &C, DeclContext *DC,
                              SourceLocation L, unsigned D, unsigned P,
                              IdentifierInfo *Id, bool Typename) {
-  return new (C) TemplateTypeParmDecl(DC, L, D, P, Id, Typename);
+  QualType Type = C.getTemplateTypeParmType(D, P, Id);
+  return new (C) TemplateTypeParmDecl(DC, L, Id, Typename, Type);
 }
 
 //===----------------------------------------------------------------------===//