[LLVMbugs] [Bug 17750] New: [-cxx-abi microsoft] Layout of interesting type not compatible

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 31 04:12:43 PDT 2013


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

            Bug ID: 17750
           Summary: [-cxx-abi microsoft] Layout of interesting type not
                    compatible
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider the following (32-bit!) program:
#include <stddef.h>
#include <stdio.h>
#include <string.h>
char buffer[419430400];
inline void *operator new(size_t, void *pv) { return pv; } 
struct TypeName11 {};  
struct TypeName17: public TypeName11 { 
 float TypeName17FieldName0;
 TypeName17() {
        printf("%llu\n", (unsigned long long)((size_t)&TypeName17FieldName0 -
(size_t)buffer));
 }
};
struct TypeName21 : public virtual TypeName11 {};
struct TypeName33 : public TypeName21, public TypeName17 {};
int main() {
 memset(buffer, 0, sizeof(buffer));
 new (buffer) TypeName33;
}

This will print out "4" when compiled with clang and "8" when compiled with
msvc.

-- 
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/20131031/81fec485/attachment.html>


More information about the llvm-bugs mailing list