[cfe-dev] Possible fix for codegen bug with cond ? func1 : func2

Eli Friedman eli.friedman at gmail.com
Fri May 16 13:28:12 PDT 2008


On Fri, May 16, 2008 at 12:30 PM, Ted Kremenek <kremenek 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?
>
> An implicit cast is preferable to other clients (the static analyzer being
> one of them).  It puts the logic of such type munging into a single place,
> and makes the invariants of the ASTs more logically consistent.
>

Okay, then I'll back out my codegen patch and re-fix this in Sema.

-Eli



More information about the cfe-dev mailing list