diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-09-02 09:37:00 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-09-02 09:37:00 +0000 |
commit | de09ce03c48e6de78b7c2107acd3358c7f758c3c (patch) | |
tree | 36dd82b4abe08880ef8c6cbfbd4da4248861b560 /clang/test/Sema/init.c | |
parent | 52b181206f842450cf407b9af3140815181ee318 (diff) | |
download | bcm5719-llvm-de09ce03c48e6de78b7c2107acd3358c7f758c3c.tar.gz bcm5719-llvm-de09ce03c48e6de78b7c2107acd3358c7f758c3c.zip |
Fix for PR2747: allow pointer->int casts with a null base; these are
offset-of-like expressions.
llvm-svn: 55627
Diffstat (limited to 'clang/test/Sema/init.c')
-rw-r--r-- | clang/test/Sema/init.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/init.c b/clang/test/Sema/init.c index 964118ce021..10eed146a0d 100644 --- a/clang/test/Sema/init.c +++ b/clang/test/Sema/init.c @@ -58,3 +58,11 @@ union { float f; unsigned u; } u = { 1.0f }; int f3(int x) { return x; } typedef void (*vfunc)(void); void *bar = (vfunc) f3; + +// PR2747 +struct sym_reg { + char nc_gpreg; +}; +int sym_fw1a_scr[] = { + ((int)(&((struct sym_reg *)0)->nc_gpreg)) & 0 +}; |