template object's template friend functions and namespaces
问题 In the following C++ example code, GCC 6 and Clang 3.8 disagree on what the correct behaviour is: This contrived example "works" -- as in the test() function returns o.p in GCC. In clang, it calls the (undefined) function get<int, int, float, double> : template<typename ...Args> class obj { bool p = false; template<typename T, typename... Args2> friend T get(const obj<Args2...> &o) { return o.p; } }; template<typename T, typename... Args> T get(const obj<Args...> &o); bool test(const obj<int,