Bug 37465

Summary: ctors never override virtual functions
Product: gcc Reporter: Mike Stump <mikestump>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal Keywords: rejects-valid
Priority: P3    
Version: 4.4.0   
Target Milestone: ---   
Host: Target:
Build: Known to work: 4.6.3, 4.7.0
Known to fail: 3.3, 4.0.1, 4.3.0, 4.4.0 Last reconfirmed: 2008-09-14 04:54:06

Description Mike Stump 2008-09-10 18:02:43 UTC
class A {
 virtual int B() { return 0; }
};

class B: A {
 B() { }
};

gives an error, but should compile (as gross as it is).  I'm hoping there is a prohibition against it, but didn't find one.
Comment 1 Mike Stump 2008-09-10 18:28:23 UTC
radr://6202462
Comment 2 Andrew Pinski 2008-09-14 04:54:02 UTC
Confirmed, looks related to covariant returns.
Comment 3 Andrew Pinski 2008-09-14 04:54:06 UTC
Confirmed, looks related to covariant returns.
Comment 4 David Fang 2008-09-27 23:01:01 UTC
Ick.
Also fails 4.3.2, 4.0.1, 3.3.
Comment 5 Paolo Carlini 2012-01-05 01:03:19 UTC
Fixed.