Bug 53453 - [2.96-98] Bad error message for invalid c++ code
[2.96-98] Bad error message for invalid c++ code
Status: CLOSED UPSTREAM
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-09-09 11:40 EDT by Bernhard Rosenkraenzer
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-01 19:56:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernhard Rosenkraenzer 2001-09-09 11:40:17 EDT
Description of Problem:
Compiling the following (invalid) code:
class foo {
public:
        foo();
};

class bar: public foo {
private:
        int &a;
};

foo::foo() {
}

int main(int argc, char **argv)
{
        bar x;
}


Returns:
test.cpp: In function `int main (int, char **)':
test.cpp:16: no matching function for call to `bar::bar ()'
test.cpp:9: candidates are: bar::bar (const bar &)

Rather than:
test.cpp:14: uninitialized reference member `bar::a'

(which you get when bar doesn't inherit foo).

Version-Release number of selected component (if applicable):
2.96-98

How Reproducible:
100%
Comment 1 Richard Henderson 2004-10-01 19:56:59 EDT
Agreed.  Pushed upstream to 
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17788
for tracking.

Note You need to log in before you can comment on or make changes to this bug.