This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/47985] New: suppose pure abstract function resolve error


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]