shithub: scc

Download patch

ref: e1bdd5948f935789d21a717ff7ec7cd95ece4b31
parent: 135cd72730a8a7284d8408576177f397f241919e
author: Michael Forney <mforney@mforney.org>
date: Mon Feb 13 13:40:44 EST 2017

[cc1] Allow TYPEIDEN in cast

This enables casts to typedef types.

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -877,6 +877,7 @@
 	switch (yytoken) {
 	case TQUALIFIER:
 	case TYPE:
+	case TYPEIDEN:
 		tp = typename();
 		expect(')');
 
--- /dev/null
+++ b/tests/execute/0110-typedefcast.c
@@ -1,0 +1,2 @@
+typedef int myint;
+myint x = (myint)1;
--- 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