[LLVMbugs] [Bug 10953] New: codegen failure with empty C++0x unions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Sep 18 03:57:59 PDT 2011


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

           Summary: codegen failure with empty C++0x unions
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following code triggers an assertion in clang codegen:

$ cat union.cpp
union Union {
  Union() {}
} u;
$ clang++ -std=c++0x union.cpp
clang: /mnt/clang-2/src/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp:982:
clang::CodeGen::CGRecordLayout*
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(const clang::RecordDecl*,
llvm::StructType*): Assertion `AlignedNonVirtualTypeSizeInBits ==
getTargetData().getTypeAllocSizeInBits(BaseTy) && "Type size mismatch!"'
failed.
0  clang           0x0000000001bb49bf
1  clang           0x0000000001bb6c32
2  libpthread.so.0 0x00007fc1e81d28f0
3  libc.so.6       0x00007fc1e74c1a75 gsignal + 53
4  libc.so.6       0x00007fc1e74c55c0 abort + 384
5  libc.so.6       0x00007fc1e74ba941 __assert_fail + 241
6  clang           0x00000000008f0c42
clang::CodeGen::CodeGenTypes::ComputeRecordLayout(clang::RecordDecl const*,
llvm::StructType*) + 3090
7  clang           0x000000000080b61e
clang::CodeGen::CodeGenTypes::ConvertRecordDeclType(clang::RecordDecl const*) +
2238
8  clang           0x000000000080bf81
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) + 625
9  clang           0x000000000080ccee
clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType) + 30

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list