public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3706: covariant returns and virtual inheritance
@ 2001-07-17  2:46 j.hannemann
  0 siblings, 0 replies; only message in thread
From: j.hannemann @ 2001-07-17  2:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3706
>Category:       c++
>Synopsis:       covariant returns and virtual inheritance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 17 02:46:04 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jens Hannemann
>Release:        3.0
>Organization:
>Environment:
System: SunOS dortmund 5.6 Generic_105181-05 sun4u sparc SUNW,Ultra-60
Architecture: sun4
host: sparc-sun-solaris2.6
build: sparc-sun-solaris2.6
target: sparc-sun-solaris2.6
configured with: ../gcc-3.0/configure --prefix=/usr/local/gcc3
>Description:
When using covariant returns (such as in "virtual constructors")
in conjunction with virtual inheritance, g++ gives the error:
"foo.cpp:8: sorry, not implemented: adjusting pointers for covariant returns"
Behavior for non-virtual inheritance is correct.
I tried this with gcc 2.95.3, gcc 3.0 and the latest snapshot using CodeSourcery's
online compiler as of July 17, 2001.
>How-To-Repeat:
class A
{
  public:
  virtual A* clone() const = 0;
};
 
class B: public virtual A
{
  public:
  virtual B* clone() const {return(new B(*this));}
};
 
int main()
{
  B* b = new B;
  B* c = b->clone();
  return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-07-17  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17  2:46 c++/3706: covariant returns and virtual inheritance j.hannemann

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