You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirmed, we're probably leaving the "no access checking errors" context before checking and converting the arguments rather than afterwards.
We also seem to get this wrong for both the overloaded and non-overload case for a partial specialization, for which the same rules apply ([temp.class.spec]p10):
template<typename T, void (TestClass::*)()> class TemplateClass2 {};
template class TemplateClass2<T, &TestClass::func>;
template class TemplateClass2<T, &TestClass::func2>;
... but it looks like we don't implement the rule at all for partial specializations.
Extended Description
Consider the following code:
class TestClass {
private:
void func();
void func2();
void func2(int);
};
template <void (TestClass::*)()> class TemplateClass { };
template class TemplateClass<&TestClass::func>;
template class TemplateClass<&TestClass::func2>;
clang rejects the second instantiation while gcc does not. If I'm reading the standard correctly we should accept both.
The text was updated successfully, but these errors were encountered: