Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Tambre__Raul
Beginner
279 Views

Pack argument function overload specialization missing arguments not diagnosed

#include <string>

extern void use(int);

template<class... Ts>
void f(int i=1, Ts... ts)
{
	use(sizeof...(Ts));
}

template<>
void f<std::string>(int i, std::string j)
{
	use(j.size());
}

void test1()
{
	f<std::string>();
}

Godbolt
With -std=c++17 -O2 this compiles to std::abort().
I believe this should fail to compile due to none of the required parameters for the std::string specialization not being given.

Related C++ Defect Reports:
DR777
DR2233

0 Kudos
2 Replies
RahulV_intel
Moderator
279 Views

Hi,

Thanks for raising this issue. I've gone through the links provided. Ideally, as per the latest standard, ICPC should've thrown compilation error, but its not. 

We will escalate this issue to the concerned team, referring to the latest C++ standards(DR777, DR2233).

 

--Rahul

PrasanthD_intel
Moderator
84 Views

Hi Raul,


The version against which you reported your issue is no longer targeted for fixes. Please check out the new versions of Intel oneAPI Toolkits for the latest features..

We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Regards

Prasanth


Reply