assertion triggered: "Illegal argument to getIntegerConstantExpr"

hi

uloziste /tmp$ cat cat.c
#include <sys/un.h>

#include <stddef.h>

void
main()
{
     int len = offsetof(struct sockaddr_un, sun_path[len+1]);
}
uloziste /tmp$ ccc cat.c
Assertion failed: (success && "Illegal argument to getIntegerConstantExpr"), function getIntegerConstantExprValue,
file /usr/ports/devel/llvm-devel/work/llvm-2.4.snap20081014/tools/clang/lib/AST/../../include/clang/AST/Expr.h,
line 105.
uloziste /tmp$

with llvm/clang-2.4 from 20081014 date. This is a stripped down test-case of a larger
program so dont wonder why it looks like it does :slight_smile:

roman

Hi Roman,

I can't debug this without the contents of sys/un.h. Can you please generate a .i file with "clang -E cat.c -o cat.i" and attach that? Thanks,

-Chris

here it is:

cat.i (3.48 KB)

Thanks! I filed:
http://llvm.org/bugs/show_bug.cgi?id=2910

-Chris