From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27517 invoked by alias); 25 Sep 2002 11:36:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 27491 invoked by uid 71); 25 Sep 2002 11:36:01 -0000 Resent-Date: 25 Sep 2002 11:36:01 -0000 Resent-Message-ID: <20020925113601.27489.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, swoh@paradise.net.nz Received: (qmail 27387 invoked by uid 61); 25 Sep 2002 11:34:59 -0000 Message-Id: <20020925113459.27386.qmail@sources.redhat.com> Date: Wed, 25 Sep 2002 04:36:00 -0000 From: swoh@paradise.net.nz Reply-To: swoh@paradise.net.nz To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8033: compile error when calling base class protected constructor from derived class function X-SW-Source: 2002-09/txt/msg00664.txt.bz2 List-Id: >Number: 8033 >Category: c++ >Synopsis: compile error when calling base class protected constructor from derived class function >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Sep 25 04:36:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: ori hecht >Release: 2.95.3-5 (cygwin special) >Organization: >Environment: cygwin on win2000 >Description: 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. >How-To-Repeat: g++ tst.c >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="tst.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="tst.c" DQoNCmNsYXNzIEJhc2Ugew0KICBwdWJsaWM6DQogICAgdmlydHVhbCB+QmFzZSgpIHt9DQoNCiAg ICBCYXNlKiBiYWRCKHZvaWQpIHtyZXR1cm4gbmV3IEJhc2UoNSk7fQ0KDQogIHByb3RlY3RlZDoN CiAgICBCYXNlKGludCkge30NCg0KICAgIGludCBnKGludCkge3JldHVybiA1O30NCn07DQoNCg0K Y2xhc3MgRGVyaXZlZDogcHVibGljIEJhc2Ugew0KICBwdWJsaWM6DQogICAgRGVyaXZlZCh2b2lk KTogQmFzZSgzKSB7fQ0KICAgIHZpcnR1YWwgfkRlcml2ZWQoKSB7fQ0KDQogICAgQmFzZSogYmFk RCh2b2lkKSB7cmV0dXJuIG5ldyBCYXNlKDUpO30NCiAgICBpbnQgZ29vZCh2b2lkKSB7cmV0dXJu IGcoNyk7fQ0KfTsNCg0KaW50IG1haW4oKQ0Kew0KICByZXR1cm4gMTsNCn0NCg0K