scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 6fe29ddc7ef5e0f52dd79dcd919aaeed275f81a8
parent a30f8e9edfde16e4d231503214333ff340f24b29
Author: Michael Forney <mforney@mforney.org>
Date:   Mon, 13 Feb 2017 18:40:44 -0800

[cc1] Allow TYPEIDEN in cast

This enables casts to typedef types.

Diffstat:
Mcc1/expr.c | 1+
Atests/execute/0110-typedefcast.c | 2++
Mtests/execute/scc-tests.lst | 1+
3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -877,6 +877,7 @@ cast(int needdecay) switch (yytoken) { case TQUALIFIER: case TYPE: + case TYPEIDEN: tp = typename(); expect(')'); diff --git a/tests/execute/0110-typedefcast.c b/tests/execute/0110-typedefcast.c @@ -0,0 +1,2 @@ +typedef int myint; +myint x = (myint)1; diff --git a/tests/execute/scc-tests.lst b/tests/execute/scc-tests.lst @@ -100,3 +100,4 @@ 0107-bnot.c 0108-bug.c 0109-struct.c +0110-typedefcast.c