I have an example that illustrates the problem since it is rather hard to describe in an easy to understand way. Notice how the alternative constructor for C gives an unrelated compile time error (that may be a separate or related problem). This could be understood and accepted behavior but it really does seem quite strange... please tell me if this is the way things should work (C++ standard does not endorse this behavior, does it?).
class A; class C { public: C(int i, A const &test) : m_test(test) { i = 0;} C(A const &test) : m_test(test) {} void a() const; private: A const & m_test; }; class A { public: virtual ~A() {} virtual void a() const = 0; }; void C::a() const { m_test.a(); } class B : public A { public: void a() const { int i = 1; i *= 1; } }; int main() { // using this constructor causes "error: request for member 'a' in 'c', which is of non-class type 'C ()(B (*)())'" //C c(B()); // this constructor allows the example to compile C c(1, B()); c.a(); } -- Summary: pure virtual function called on const & declared with previous declaration without a definition, const & assigned by temporary Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mjtruog at fastmail dot ca http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30340