Open ggreif opened 11 years ago
This is in 3.4 still.
Btw. is there an official translation of the binary operator to the ternary one? How does GCC do it?
@llvm/issue-subscribers-clang-frontend
Author: Gabor Greif (ggreif)
CC @zygoloid any pointers here, I think we want to remain compatible. I guess we need to fix something in Sema::CXXCheckConditionalOperands
Extended Description
$ clang gnutest.cc gnutest.cc:7:10: error: cannot initialize return object of type 'Howdy' with an rvalue of type 'int' return you ?: Hi; ^
~~~~ 1 error generated.This works nicely with g++ (v3.4 and v4.4). I guess clang models this as
while g++ does:
The test program is:
$ cat gnutest.cc