[LLVMbugs] [Bug 18444] New: [-cxx-abi microsoft] Layout involving pragma pack and declspec(align) is wrong

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jan 11 09:42:53 PST 2014


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

            Bug ID: 18444
           Summary: [-cxx-abi microsoft] Layout involving pragma pack and
                    declspec(align) is wrong
           Product: clang
           Version: unspecified
          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:

extern "C" int printf(const char *fmt, ...);
struct A {
  bool Field;
};
#pragma pack(push, 1)
struct B : public A {
  __declspec(align(2)) bool Field;
};
#pragma pack(pop)
struct C : public B, public A {};

int main() {
  printf("sizeof(C): %d\n", sizeof(C));
}

clang gets:
sizeof(C): 6

msvc gets:
sizeof(C): 4

-- 
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/20140111/1319b4a6/attachment.html>


More information about the llvm-bugs mailing list