    QualType getSubstTemplateTypeParmPackType(
                                            const TemplateTypeParmType *Replaced,
                                              const TemplateArgument &ArgPack);
---- ./tools/clang/lib/Sema/SemaTemplateInstantiate.cpp	2013-04-11 09:34:54.065163939 +0200
-+++ ./tools/clang/lib/Sema/SemaTemplateInstantiate.cpp	2013-04-24 19:40:14.329498012 +0200
-@@ -1421,7 +1421,8 @@
- 
-     // TODO: only do this uniquing once, at the start of instantiation.
-     QualType Result
--      = getSema().Context.getSubstTemplateTypeParmType(T, Replacement);
-+      = getSema().Context.getSubstTemplateTypeParmType(T, Replacement,
-+                          HackForDefaultTemplateArg::AllowNonCanonicalSubst());
-     SubstTemplateTypeParmTypeLoc NewTL
-       = TLB.push<SubstTemplateTypeParmTypeLoc>(Result);
-     NewTL.setNameLoc(TL.getNameLoc());
-@@ -1467,7 +1468,8 @@
-   QualType Result = ArgPack.pack_begin()[Index].getAsType();
-   Result = getSema().Context.getSubstTemplateTypeParmType(
-                                       TL.getTypePtr()->getReplacedParameter(),
--                                                          Result);
-+                                                          Result,
-+                           HackForDefaultTemplateArg::AllowNonCanonicalSubst());
-   SubstTemplateTypeParmTypeLoc NewTL
-     = TLB.push<SubstTemplateTypeParmTypeLoc>(Result);
-   NewTL.setNameLoc(TL.getNameLoc());
---- ./tools/clang/lib/Sema/TreeTransform.h	2013-04-11 09:34:54.069163897 +0200
-+++ ./tools/clang/lib/Sema/TreeTransform.h	2013-04-24 19:40:14.301498233 +0200
-@@ -36,6 +36,8 @@
- #include "llvm/Support/ErrorHandling.h"
- #include <algorithm>
- 
-+#include "HackForDefaultTemplateArg.h"
-+
- namespace clang {
- using namespace sema;
- 
-@@ -4587,7 +4589,7 @@
-   Replacement = SemaRef.Context.getCanonicalType(Replacement);
-   QualType Result
-     = SemaRef.Context.getSubstTemplateTypeParmType(T->getReplacedParameter(),
--                                                   Replacement);
-+                                                   Replacement,false);
- 
-   // Propagate type-source information.
-   SubstTemplateTypeParmTypeLoc NewTL
---- ./tools/clang/lib/AST/ASTContext.cpp	2013-04-11 09:34:54.289161610 +0200
-+++ ./tools/clang/lib/AST/ASTContext.cpp	2013-04-24 19:40:14.533496400 +0200
-@@ -2862,9 +2862,13 @@
+diff --git lib/AST/ASTContext.cpp lib/AST/ASTContext.cpp
+index 170cc02..de2853c 100644
+--- lib/AST/ASTContext.cpp
++++ lib/AST/ASTContext.cpp
+@@ -2862,9 +2862,13 @@ QualType ASTContext::getAttributedType(AttributedType::Kind attrKind,
  /// \brief Retrieve a substitution-result type.
  QualType
  ASTContext::getSubstTemplateTypeParmType(const TemplateTypeParmType *Parm,

 // Exported for use by Parser.
 SourceRange
 clang::getTemplateParamsRange(TemplateParameterList const * const *Ps,
@@ -2514,8 +2539,13 @@
     return true;
 
   // Add the converted template type argument.

   }
 
   // C++03 [temp.arg.type]p2:
@@ -3556,7 +3593,11 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param,
                                SR.getBegin()) != DiagnosticsEngine::Ignored :
       Arg->hasUnnamedOrLocalType()) {
     UnnamedLocalNoLinkageFinder Finder(*this, SR);
