This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20397] improve diagnostic for 'is inaccessible' error
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Oct 2011 07:57:59 +0000
- Subject: [Bug c++/20397] improve diagnostic for 'is inaccessible' error
- Auto-submitted: auto-generated
- References: <bug-20397-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20397
--- Comment #16 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-10-21 07:57:59 UTC ---
(In reply to comment #9)
> I am reopening as an enhancement request because all this discussion could be
> better summarized in the error message (in particular, the part about A being
> injected in B and being private).
>
> clang has a "fixit/extra info" switch that provides a long explanation for each
> error message. I wonder what error/message they give here.
Indeed, the error from clang is a bit more clear:
/tmp/webcompile/_3843_0.cc:9:8: error: 'A' is a private member of 'A'
int c(A *a) { return 7; }
^
/tmp/webcompile/_3843_0.cc:4:11: note: constrained by implicitly private
inheritance here
class B : A {
^
/tmp/webcompile/_3843_0.cc:1:7: note: member is declared here
class A {
^
but I am not sure the first error is correctly enunciated.