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]

Re: Protected constructor access rules changed?



>>>>> "Rick" == Rick Campbell <campbell@cyberpass.net> writes:

    Rick>     Date: Mon, 2 Feb 1998 17:19:00 -0800 From: mrs@wrs.com
    Rick> (Mike Stump)

    Rick>     The place to ask about validity of code is comp.lang.c++
    Rick> or comp.std.c++, or gnu.g++.help.

    Rick> I'm sorry if I presented things poorly.  I meant to be
    Rick> reporting a bug, but also to leave open the possibility that
    Rick> it was correct behavior that I was misunderstanding.

    Rick> Unless there has been some change in the language, EGCS has
    Rick> a bug in that it does not permit derived classes to invoke
    Rick> protected constructors except in an initializer form.  I

Constructors may not be called by name, except in the initializers
portion of a derived class constructor.  I *think* this has been true
since the ARM, but I could be wrong.  So, I don't believe there is a
bug here.

    Rick> don't believe that there is a distinction wrt the spec
    Rick> between calling such a constructor from an initializer and
    Rick> calling it from the body.  G++ 2.7.2 exhibits the same bug
    Rick> which was introduced sometime after version 2.3.3 which
    Rick> correctly compiles the example that I included in my last
    Rick> message.

    Rick> 			Rick


-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu



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