diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index 2f52620d..404c8bbe 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -222,7 +222,6 @@ broken="$broken 28_strings 31_args -32_led 34_array_assignment 37_sprintf 38_multiple_array_index diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index fc57bf53..51a9263e 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -305,15 +305,15 @@ (let ((rank (pointer->rank pointer))) (rank+= (ast->type type info) rank))) - ((decl-spec-list (type-spec ,type)) - (ast->type type info)) + ((decl-spec-list (type-spec ,type)) (ast->type type info)) - ;; `typedef int size; void foo (unsigned size u) + ;; ;; `typedef int size; void foo (unsigned size u) ((decl-spec-list (type-spec ,type) (type-spec ,type2)) (ast->type type info)) - ((assn-expr ,a ,op ,b) - (ast->type a info)) + ((assn-expr ,a ,op ,b) (ast->type a info)) + + ((cond-expr _ ,a ,b) (ast->type a info)) (_ (get-type o info)))) diff --git a/scaffold/tests/41-?.c b/scaffold/tests/41-?.c index 8bc4b47d..ad8b5f69 100644 --- a/scaffold/tests/41-?.c +++ b/scaffold/tests/41-?.c @@ -21,6 +21,11 @@ #include "30-test.i" #include +union foo +{ + int i; +}; + int test () { @@ -33,7 +38,10 @@ test () (one == 1) ? 1 : exit (1); puts ("t: (f) ?\n"); - (f) ? exit (1) : 1; + (f) ? exit (2) : 1; + + union foo fu; + fu.i = 1 ? 0 : 1; return 0; }