Bug 8033 - compile error when calling base class protected constructor from derived class function
Summary: compile error when calling base class protected constructor from derived clas...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 2.95.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2002-09-25 04:36 UTC by swoh
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
tst.c (181 bytes, application/octet-stream)
2003-05-21 15:16 UTC, swoh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description swoh 2002-09-25 04:36:00 UTC
The compiler refuses to call a protected constructor of a base class from a member function of a class derived from it.

The compiler output is:

tst.c: In method 'class B * Derived::bad()':
tst.c:10: 'Base::Base(int)' is protected
tst.c:21: within this context
 

NOTE: how can I attach both the .c file and the .ii file through the GNATS interface? The selector allows me only one choice.

Release:
2.95.3-5 (cygwin special)

Environment:
cygwin on win2000

How-To-Repeat:
g++ tst.c
Comment 1 Nathan Sidwell 2002-09-30 10:10:22 UTC
State-Changed-From-To: open->closed
State-Changed-Why: not a bug. derived only has access to protected base members
    of the 'this' object. [11.2]/4 && [11.5]