Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang++ fails on ?: operator with bit fields in struct #12095

Open Quuxplusone opened 12 years ago

Quuxplusone commented 12 years ago
Bugzilla Link PR11968
Status NEW
Importance P normal
Reported by llvm.20.dufflebunk@spamgourmet.com
Reported on 2012-02-10 00:20:27 -0800
Last modified on 2012-02-17 05:13:42 -0800
Version 3.0
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, rafael@espindo.la
Fixed by commit(s)
Attachments test.cpp (513 bytes, text/x-c++src)
Blocks
Blocked by
See also
Created attachment 8030
Fails to compile

The attached short test case compiles without error with g++, but fails with
clang++.

clang++ -o test.o -c test.cpp -v
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/home/pmahon/opt/llvm-3.0/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.21.53.20110810 -momit-leaf-frame-pointer -v -coverage-file test.o -resource-dir /home/pmahon/opt/llvm-3.0/bin/../lib/clang/3.0 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /home/pmahon/opt/llvm-3.0/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fmessage-length 210 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp
clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
 /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
 /usr/local/include
 /home/pmahon/opt/llvm-3.0/bin/../lib/clang/3.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
test.cpp:28:3: error: cannot compile this conditional operator yet
  (a==0) ? (b->C |= (d) ? 0 : 1) : (b->D |= (d) ? 0 : 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Quuxplusone commented 12 years ago

Attached test.cpp (513 bytes, text/x-c++src): Fails to compile