This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]