[LLVMbugs] [Bug 16659] New: Abstract class with virtual base

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 19 01:00:43 PDT 2013


            Bug ID: 16659
           Summary: Abstract class with virtual base
           Product: clang
           Version: 3.3
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: m-ou.se at m-ou.se
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Currently, clang++ rejects the following code:

    struct base {
        explicit base(int) {}
        virtual void foo() = 0;
        virtual ~base() {}

    struct left : virtual base {};
    struct right : virtual base {};

    struct derived : left, right {
        virtual void foo() override {}
        derived() : base(10) {}

    int main() {}

The code is correct according to:

(Summarized: The code is rejected because left and right don't have a
constructor that initializes their virtual base. However, left and right will
never have to initialize their virtual base, since they are abstract and thus
will never be the 'most derived class'.)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130719/15d738d9/attachment.html>

More information about the llvm-bugs mailing list