http://llvm.org/bugs/show_bug.cgi?id=20729

            Bug ID: 20729
           Summary: Explicit base destructor call rejected
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

#include <new>

struct b {
        virtual ~ b() {}
};

struct d : b {
        ~ d () {}
};

int main() {
        d o;
        o.~b();
        new( & o ) d;
}


This is well formed but gets a diagnosis "destructor type 'b' in object
destruction expression does not match the type 'd' of the object being
destroyed".

The most applicable rule is §12.4/13:

… if the object is not of the destructor’s class type and not of a class
derived from the destructor’s class type (including when the destructor is
invoked via a null pointer value), the program has undefined behavior.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to