public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: catherin@ca.ibm.com To: gcc-gnats@gcc.gnu.org Subject: c++/7886: g++ 3.2 indicates ambigous base ctor when its not ambiguous Date: Wed, 11 Sep 2002 05:26:00 -0000 [thread overview] Message-ID: <20020911122459.18422.qmail@sources.redhat.com> (raw) >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:
next reply other threads:[~2002-09-11 12:26 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-09-11 5:26 catherin [this message] 2002-09-13 7:51 nathan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020911122459.18422.qmail@sources.redhat.com \ --to=catherin@ca.ibm.com \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).