[cfe-dev] Possible fix for codegen bug with cond ? func1 : func2
Chris Lattner
clattner at apple.com
Fri May 16 12:26:34 PDT 2008
On May 16, 2008, at 12:22 PM, Eli Friedman wrote:
> On Fri, May 16, 2008 at 12:18 PM, Chris Lattner <clattner at apple.com>
> wrote:
>>> Testcase (currently crashes with clang -emit-llvm):
>>> int a();
>>> int b(int);
>>> int c() {return 1 ? a : b;}
>>
>> Should sema be inserting an implicit cast to the common type?
>
> I suppose that's a possibility; which way are users outside of codegen
> likely to prefer?
It would be a nice invariant for the LHS/RHS of ?: to have the same
type as the result of the ?:
-Chris
More information about the cfe-dev
mailing list