#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.