-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Invalid private check for member addresses #36772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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<typename T> class TemplateClass2<T, &TestClass::func>;
template<typename T> class TemplateClass2<T, &TestClass::func2>; ... but it looks like we don't implement the rule at all for partial specializations. |
Addressed in https://reviews.llvm.org/D78404. |
@llvm/issue-subscribers-clang-frontend Author: Anton Korobeynikov (asl)
| | |
| --- | --- |
| Bugzilla Link | [37424](https://llvm.org/bz37424) |
| Version | trunk |
| OS | All |
| CC | @DougGregor,@broadwaylamb,@zygoloid |
Extended DescriptionConsider 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. |
clang accepts both now: https://godbolt.org/z/KPEvoWd3o |
Extended Description
Consider the following code:
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: