public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7886: g++ 3.2 indicates ambigous base ctor when its not ambiguous
@ 2002-09-13  7:51 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-13  7:51 UTC (permalink / raw)
  To: catherin, gcc-bugs, gcc-prs, nobody

Synopsis: g++ 3.2 indicates ambigous base ctor when its not ambiguous

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Fri Sep 13 07:51:00 2002
State-Changed-Why:
    confirmed 12.6.2/2

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7886


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/7886: g++ 3.2 indicates ambigous base ctor when its not ambiguous
@ 2002-09-11  5:26 catherin
  0 siblings, 0 replies; 2+ messages in thread
From: catherin @ 2002-09-11  5:26 UTC (permalink / raw)
  To: gcc-gnats


>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-13 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-13  7:51 c++/7886: g++ 3.2 indicates ambigous base ctor when its not ambiguous nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-09-11  5:26 catherin

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).