lcc icon indicating copy to clipboard operation
lcc copied to clipboard

Fixed to handle composite types in conditional expressions

Open mycoboco opened this issue 10 years ago • 0 comments

lcc currently fails to correctly handle composite types in conditoinal expressions. For example,

void foo(void)
{
    extern int cond;
    int (*a)[], (*b)[10], (*c)[20];

    c = cond? a: b;
    c = cond? b: a;
}

The two assignments to c are both invalid, but lcc complains that only the latter is.

This commit fixes the problem by adding two calls to composite() when checking types for conditional expressions.

mycoboco avatar Dec 11 '14 23:12 mycoboco