g++ 4.8.1 and clang++ 3.4 give different results for next code:
// simplified code from a Logger module #include <iostream> template<class T> void tf(const T*) { // clang++ std::cout << "void tf(const T*)\n"; } template<class T> void tf(T) { // g++ std::cout << "void tf(T)\n"; } int main(){ typedef std::ios_base& (*ph)(std::ios_base&); ph p = std::hex; tf(p); // or just tf(std::hex) } I can't figure out which variant is correct (C++ 03).
auto const * p = std::hex;allowed? GCC says NO but Clang says YES. So who is right?template<class T> tf(T*)overload, then g++ will selec that one, but clang keeps going for theconst T*overlaod.