Bug 3706 - ABI:covariant returns and virtual inheritance
Summary: ABI:covariant returns and virtual inheritance
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 5607 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-07-17 02:46 UTC by j.hannemann
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host: sparc-sun-solaris2.6
Target: sparc-sun-solaris2.6
Build: sparc-sun-solaris2.6
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description j.hannemann 2001-07-17 02:46:04 UTC
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.

Release:
3.0

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

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;
}
Comment 1 Nathan Sidwell 2001-07-21 15:25:18 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: confirmed
Comment 2 Nathan Sidwell 2002-12-27 10:30:42 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: 2002-12-03  Nathan Sidwell  <nathan@codesourcery.com>
    
    	Implement covariant returns.
    this will appear in 3.4, not 3.3 (unfortunately)