[cfe-dev] Potential bug in class template argument deduction

Hamza Sood via cfe-dev cfe-dev at lists.llvm.org
Tue Aug 15 03:04:45 PDT 2017


template<typename T>
class Base { };

class Derived: public Base<int> { };

int main() {
    Derived d;
    Base b(d);
    return 0;
}


Clang rejects that code, saying it can’t deduce the template parameters for Base.
However I think that code is valid; it’s accepted by GCC.
Is this a Clang bug?


More information about the cfe-dev mailing list