Make sure we consistently canonicalize types when canonicalizing TemplateTemplateParmDecls. PR12179.

llvm-svn: 152189
This commit is contained in:
Eli Friedman 2012-03-07 01:09:33 +00:00
parent eadd8ee49c
commit 205a429891
2 changed files with 11 additions and 3 deletions

View File

@ -74,12 +74,14 @@ ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID,
if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(*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;

View File

@ -54,3 +54,9 @@ namespace N {
void f0( Y<int,1> y){ 1 << y; } // expected-note{{in instantiation of function template specialization 'N::operator<<<Y, int, 1>' requested here}}
}
// PR12179
template <typename Primitive, template <Primitive...> class F>
struct unbox_args {
typedef typename Primitive::template call<F> x;
};