From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18642 invoked by alias); 11 Sep 2002 12:26:02 -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 18624 invoked by uid 71); 11 Sep 2002 12:26:02 -0000 Resent-Date: 11 Sep 2002 12:26:02 -0000 Resent-Message-ID: <20020911122602.18622.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, catherin@ca.ibm.com Received: (qmail 18423 invoked by uid 61); 11 Sep 2002 12:24:59 -0000 Message-Id: <20020911122459.18422.qmail@sources.redhat.com> Date: Wed, 11 Sep 2002 05:26:00 -0000 From: catherin@ca.ibm.com Reply-To: catherin@ca.ibm.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/7886: g++ 3.2 indicates ambigous base ctor when its not ambiguous X-SW-Source: 2002-09/txt/msg00186.txt.bz2 List-Id: >Number: 7886 >Category: c++ >Synopsis: g++ 3.2 indicates ambigous base ctor when its not ambiguous >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Wed Sep 11 05:26:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Catherine Morton >Release: gcc version 3.2 >Organization: >Environment: Using version 3.2 on SuSE Linux on powerpc g++ -v abc.cpp Reading specs from /.../torolab.ibm.com/fs/proj/p0/vabld/run/gcc/linux_ppc/3.2.0/lib/gcc-lib/pow erpc-unknown-linux-gnu/3.2/specs Configured with: /build/gcc/gcc-3.2/configure -prefix=/.../torolab.ibm.com/fs/proj/p0/vabld/run/ gcc/linux_ppc/3.2.0 -enable-threads=posix -enable-languages=c,c++ -disable-shared Thread model: posix gcc version 3.2 /.../torolab.ibm.com/fs/proj/p0/vabld/run/gcc/linux_ppc/3.2.0/lib/gcc-lib/powerpc-unknown-linux -gnu/3.2/cc1plus -v -iprefix /usr/bin/../lib/gcc-lib/powerpc-unknown-linux-gnu/3.2/ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -DPPC -D__ELF__ -Dpowerpc -D __PPC__ -D__ELF__ -D__powerpc__ -D__PPC -D__powerpc -Acpu=powerpc -Amachine=powerpc -D__NO_INLIN E__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bige ndian -D_ARCH_PPC -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asys tem=unix -Asystem=posix abc.cpp -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase abc. cpp -version -o /tmp/ccxghi7p.s GNU CPP version 3.2 (cpplib) (PowerPC GNU/Linux) GNU C++ version 3.2 (powerpc-unknown-linux-gnu) compiled by GNU C version 3.2. >Description: The_Creator base class is not ambiguous. There are two of them. One is shared between XYParent and YYParent. The other is owned by Surrogate. The constructor call for The_Creator() is not ambiguous. It seems to think that it should call a copy constructor, but The_Creator(int i) is perfectly fine. >How-To-Repeat: // ----- begin abc.cpp ------- struct TheCreator { TheCreator( int i ) { } ~TheCreator() { } } ; struct XYParent : public virtual TheCreator { XYParent( int i ) : TheCreator(i) { } ~XYParent() { } } ; struct YYParent : public virtual TheCreator { YYParent( int i ) : TheCreator(i) { } ~YYParent() { } } ; struct Surrogate : public TheCreator { Surrogate( int i ) : TheCreator(i) { } ~Surrogate() { } } ; struct Filler : public XYParent, private YYParent, protected Surrogate { Filler( const Filler& copy ) : XYParent(1),YYParent(2), Surrogate(3), TheCreator(4) { } Filler( int i ) : XYParent(i), YYParent(i), Surrogate(i),TheCreator(i){ } ~Filler() { } } ; int main() { return 1; } // -------- end abc.cpp --------------- g++ abc.cpp abc.cpp: In copy constructor `Filler::Filler(const Filler&)': abc.cpp:22: `TheCreator' is an ambiguous base of `Filler' abc.cpp:22: no matching function for call to `TheCreator::TheCreator()' abc.cpp:1: candidates are: TheCreator::TheCreator(const TheCreator&) abc.cpp:2: TheCreator::TheCreator(int) abc.cpp: In constructor `Filler::Filler(int)': abc.cpp:23: `TheCreator' is an ambiguous base of `Filler' abc.cpp:23: no matching function for call to `TheCreator::TheCreator()' abc.cpp:1: candidates are: TheCreator::TheCreator(const TheCreator&) >Fix: >Release-Note: >Audit-Trail: >Unformatted: