https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36961

Ivan Sorokin <vanyacpp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vanyacpp at gmail dot com

--- Comment #7 from Ivan Sorokin <vanyacpp at gmail dot com> ---
(In reply to Andrew Pinski from comment #4)
> The error is correct as the type of v2 is foo so it cannot figure out the
> rest of the template agruments from that type.

I reduced the case and tested it on other compilers. clang, icc and msvc all
accept this code. The only compiler that reject this code is gcc. I don't know
if is code is conforming to C++ standard. In any case I think behavior of other
compilers is reasonable.

template<typename E>
struct temp1
{};

template<template<typename> class node>
struct temp2 {};

struct foo : public temp2<temp1> {};

template<template<typename> class Temp1,
         template<template<typename> class> class Temp2>
void f(Temp2<Temp1> v);

int main()
{
    f(temp2<temp1>());
    f(foo());
}

Reply via email to