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%
Agreed. Pushed upstream to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17788 for tracking.