[Bug c++/71568] Inexplicable error: "X is inaccessible within this context" for a public member

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Feb 25 18:13:00 GMT 2017


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.


More information about the Gcc-bugs mailing list