Bug 53453 - [2.96-98] Bad error message for invalid c++ code
Summary: [2.96-98] Bad error message for invalid c++ code
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-09 15:40 UTC by Bernhard Rosenkraenzer
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-01 23:56:59 UTC
Embargoed:


Attachments (Terms of Use)

Description Bernhard Rosenkraenzer 2001-09-09 15:40:17 UTC
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 23:56:59 UTC
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.