Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
32 Views

[bug report] Bug for template deduction?

Jump to solution

I am using Intel C++ compiler 15.0 for Windows and there's a simple case that cannot compile.

#include 

class Foo {
public:
    Foo() {}
    ~Foo() {}
    void test() const { std::cout << "Hello world!" << std::endl; }
};

template<typename T> void test(const T& t) { t.test(); }

template<typename T, void F(const T&)=test<T> >
void bar(const T& t) {
    F(t);
}

int main() {
    Foo foo;
    bar<Foo>(foo);
    return 0;
}

It can successfully compile on other compilers including msvc, g++(both linux and windows), clang++(both linux and windows) and intel compiler on linux (with std=c++11 option). However on Windows, intel compiler (again with c++11 support) complains "error : no instance of function template "bar" matches the argument list", which does not make sense at all. Anyone could confirm this bug? Thanks in advance!

0 Kudos

Accepted Solutions
Highlighted
32 Views

Hi Shenxiu,

I can reproduce the issue with 15.0 and also 16.0 beta and will submit it to developer to fix. It seems like a bug. I'll keep you updated.

Thanks,

Shenghong

View solution in original post

0 Kudos
2 Replies
Highlighted
33 Views

Hi Shenxiu,

I can reproduce the issue with 15.0 and also 16.0 beta and will submit it to developer to fix. It seems like a bug. I'll keep you updated.

Thanks,

Shenghong

View solution in original post

0 Kudos
Highlighted
32 Views

Hi Shenxiu,

This issue is fixed in v16.0 initial release, I've verified it. Please upgrade to v16.0. Let me know in case you still have issues with this test case.

Thanks,

Shenghong

0 Kudos