diff mbox

[03/20] cast: add testcase for cast to bad typeof

Message ID 20180614190419.28052-4-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck June 14, 2018, 7:04 p.m. UTC
There are special problems when a typeof() expression can't
be evaluated. Catch this here.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/cast-bad-01.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 validation/cast-bad-01.c
diff mbox

Patch

diff --git a/validation/cast-bad-01.c b/validation/cast-bad-01.c
new file mode 100644
index 000000000..4a7a397ea
--- /dev/null
+++ b/validation/cast-bad-01.c
@@ -0,0 +1,13 @@ 
+extern unsigned long l;
+
+int foo(void) {
+	return (int) (typeof(fundecl(0))) l;
+}
+
+/*
+ * check-name: cast-bad 01
+ *
+ * check-error-start
+cast-bad-01.c:4:30: error: undefined identifier 'fundecl'
+ * check-error-end
+ */