This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20397] g++ rejects valid code with 'is inaccessible' error
- From: "matthew dot whitney at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2005 02:25:03 -0000
- Subject: [Bug c++/20397] g++ rejects valid code with 'is inaccessible' error
- References: <20050309212435.20397.matthew.whitney@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From matthew dot whitney at gmail dot com 2005-03-10 02:25 -------
Could someone take another look at this? I don't mean to waste your time, but I
don't understand the explanation given. I know of another compiler that handles
the example code without any problems.
I agree that 'A is inaccessible' from C, but the code doesn't try to access it.
Consider this one word change to class C:
class C : B {
public:
int c(void *a) { return 7; }
};
Now it compiles fine. Before this is closed again I'd like to understand why it
should matter what type an unreferenced parameter is. Why shouldn't I be able to
pass a pointer to an object of type A (completely unrelated to C) to one of C's
methods? Thanks in advance.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20397