This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47985] New: suppose pure abstract function resolve error
- From: "gvolozhanin at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 4 Mar 2011 08:41:07 +0000
- Subject: [Bug c++/47985] New: suppose pure abstract function resolve error
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47985
Summary: suppose pure abstract function resolve error
Product: gcc
Version: 4.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: gvolozhanin@mail.ru
class A {
public:
virtual ~A() {}
virtual void foo()=0;
};
class B {
public:
virtual ~B() {}
virtual void foo() { }
};
class C: public B, public A {
};
int main() {
C c;
c.foo();
return 0;
}
$ g++ o.cpp
o.cpp: In function âint main()â:
o.cpp:17: error: cannot declare variable âcâ to be of abstract type âCâ
o.cpp:13: note: because the following virtual functions are pure within âCâ:
o.cpp:4: note: virtual void A::foo()
o.cpp:18: error: request for member âfooâ is ambiguous
o.cpp:4: error: candidates are: virtual void A::foo()
o.cpp:10: error: virtual void B::foo()
$ gcc --version
gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3
the bug maybe fixed already when recent visibility bugs fixed
anytime please don't waste time for the answer, best regards