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++/12265] Downcast to class which derives privately rejected


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12265


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From nathan at gcc dot gnu dot org  2003-09-12 16:46 -------
not a bug. the cast is invalid. [5.2.9]/5 says it is ok if there's a
standard conversion from derived to base.[4.10]/3 says there's a conversion,
but if the base is inaccessible or ambiguous, the program is ill-formed.
[11.2]/4 says a base is accessible if an invented public member of the base
class is accessible. members of Base, such as Base::f have no special
access to the provate bases of Derived, so the base is inaccessible in
Base::f. If the cast were in a member or friend of Derived, it would be ok.


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