This is purely based on what I understand from your defintion of 'negative' and 'fail'. These example show how to make overload resolution fail in some of the common situations
// Case 1: Two non template functions participating in overload resolution (and failing)
namespace A1{
void f(){}
}
namespace A2{
void f(){}
}
using A1::f;
using A2::f;
int main(){
f();
}
Here the compilers will give error related to the fact that the call to 'f' is ambiguous as there are two viable functions. This proves that overload resolution is happening (and failing).
Case 2: // A template and a non template participating in an unsuccessful overload resolution
namespace A1{
template<class T> int f(){}
}
namespace A2{
void f(int){}
}
using A1::f;
using A2::f;
int main(){
f();
}
// Case 3: Two template functions participating in a failed overload resolution
namespace A1{
template<class T> int f(T, int){return 0;}
}
namespace A2{
template<class T> double f(T, int){return 0;}
}
using A1::f;
using A2::f;
int main(){
f(2.2, 2.2);
}
OR better still
namespace A1{
template<class T> int f(T, int){return 0;}
}
namespace A2{
template<class T> double f(int, T){return 0;}
}
using A1::f;
using A2::f;
int main(){
f(2.2, 2.2);
}