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

            Bug ID: 17578
           Summary: Clang crash compiling offsetof member of virtual base
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Compiling the following test case caused clang front end to crash.

/* clang -S -o - test.cpp */
#include <cstddef>

struct Base {
  int a;
};

struct Derived : virtual Base 
{};

void foo() 
{ 
  int xx = offsetof(Derived, a);
}
/* end test.cpp */

clang: llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp:1849: llvm::Value*
{anonymous}::ScalarExprEmitter::VisitOffsetOfExpr(clang::OffsetOfExpr*):
Assertion `i < RL.getFieldCount() && "offsetof field in wrong type"' failed.

clang version 3.4 (trunk 191913)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

-- 
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