From: Eli Friedman Date: Wed, 7 Mar 2012 01:09:33 +0000 (+0000) Subject: Make sure we consistently canonicalize types when canonicalizing TemplateTemplateParm... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e9c454b12671a624f666fc6fbf132fdf183effc;p=clang Make sure we consistently canonicalize types when canonicalizing TemplateTemplateParmDecls. PR12179. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152189 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e122df9d23..0d6f6e612c 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -74,12 +74,14 @@ ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, if (NonTypeTemplateParmDecl *NTTP = dyn_cast(*P)) { ID.AddInteger(1); ID.AddBoolean(NTTP->isParameterPack()); - ID.AddPointer(NTTP->getType().getAsOpaquePtr()); + ID.AddPointer(NTTP->getType().getCanonicalType().getAsOpaquePtr()); if (NTTP->isExpandedParameterPack()) { ID.AddBoolean(true); ID.AddInteger(NTTP->getNumExpansionTypes()); - for (unsigned I = 0, N = NTTP->getNumExpansionTypes(); I != N; ++I) - ID.AddPointer(NTTP->getExpansionType(I).getAsOpaquePtr()); + for (unsigned I = 0, N = NTTP->getNumExpansionTypes(); I != N; ++I) { + QualType T = NTTP->getExpansionType(I); + ID.AddPointer(T.getCanonicalType().getAsOpaquePtr()); + } } else ID.AddBoolean(false); continue; diff --git a/test/SemaTemplate/temp_arg_template.cpp b/test/SemaTemplate/temp_arg_template.cpp index 9c34089e61..106111e429 100644 --- a/test/SemaTemplate/temp_arg_template.cpp +++ b/test/SemaTemplate/temp_arg_template.cpp @@ -54,3 +54,9 @@ namespace N { void f0( Y y){ 1 << y; } // expected-note{{in instantiation of function template specialization 'N::operator<<' requested here}} } + +// PR12179 +template class F> +struct unbox_args { + typedef typename Primitive::template call x; +};