This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71568] Inexplicable error: "X is inaccessible within this context" for a public member
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 25 Feb 2017 18:13:32 +0000
- Subject: [Bug c++/71568] Inexplicable error: "X is inaccessible within this context" for a public member
- Auto-submitted: auto-generated
- References: <bug-71568-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71568
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
The issue is that even though nlog_custom is public in D, the pointer-to-member
expression ends up being &F<D>::nlog_custom, and F (i.e. tuple) inherits
privately from C, so nlog_custom is private in F.
As a result, clang also rejects the testcase in comment 1, because it doesn't
select the partial specialization.
The G++ bug is giving a hard error for the access violation rather than quietly
not selecting the partial specialization.