https://llvm.org/bugs/show_bug.cgi?id=27494
Bug ID: 27494 Summary: C++ Member access control in explicit template instantiations not working Product: clang Version: trunk Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: bugfind...@gmx.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified These private member functions fail to compile when used as an argument of an explicit template instantiation: - overloaded functions - static overloaded functions - templated functions Consider the following code: struct A { private: int func(int x) { return x; } // overloaded int func(char x) { return x; } // overloaded template <typename T> int funcT(T x) { return x; } // templated }; template<int (A::*member)(int)> struct B { }; template struct B<&A::func>; template struct B<&A::funcT<int>>; int main() { return 0; } The C++ standard states in 14.7.2/12 [temp.explicit]: The usual access checking rules do not apply to names used to specify explicit instantiations. [ Note: In particular, the template arguments and names used in the function declarator (including parameter types, return types and exception specifications) may be private types or objects which would normally not be accessible and the template may be a member template or member function which would not normally be accessible. — end note ] -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs