[temp.deduct.type] paragraph 8 lists all deduced contexts, but it seems not to include template-name
<TT>
where template-name
refers to a class template and TT
refers to a template template argument. Is this a deduced context?
If it is, why?
If not, consider the following code:
template<template<typename> class U, template<typename> class V>
struct foo {};
template<template<typename> class U>
struct foo<U, U> {};
int main() {}
This code compiles under Clang 7.0.0 and GCC 8.0.1, which means the compilers consider the partial specialization is more specialized than the primary template, which means U
and V
in the primary template are successfully deduced against foo<U, U>
. Is this a compiler bug?