Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7679 Discussions

Compiler bug in XE 2015: error : no instance of function template "..." matches the argument list

Poeter__Manuel
Beginner
313 Views

Hi,

the following code:

#include <tuple>

struct Foo {
	std::tuple<int> inner;
	template <unsigned Idx>
	auto get() const -> decltype(std::get<Idx>(inner)) { return std::get<Idx>(inner); }
};

int main()
{
	Foo f;
	f.get<0>();
}

produces the following error:

1>main.cpp(12): error : no instance of function template "Foo::get" matches the argument list
1>              object type is: Foo
1>    	f.get<0>();
1>    	  ^

It seems as if the compiler is not able to deduce the trailing return type.

Best regards,
Manuel Pöter

0 Kudos
1 Reply
Amanda_S_Intel
Employee
313 Views

Thanks for your report. I also see this problem in 16.0 beta. I escalated this issue to the development team and I'll let you know when I have an update.

Reply