aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-11-24 11:43:51 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-06-23 07:46:40 +0200
commitf44e0e1a1ea604705e3bb418e09d50756d95b506 (patch)
tree7963a980dd57b0a5fefca953c80ea40f0f578622 /validation
parent9ab2dd6f368ef2d109b9d89c06d79868e9fbcc8b (diff)
downloadsparse-dev-f44e0e1a1ea604705e3bb418e09d50756d95b506.tar.gz
cast: add testcase for cast to bad typeof
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>
Diffstat (limited to 'validation')
-rw-r--r--validation/cast-bad-01.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/validation/cast-bad-01.c b/validation/cast-bad-01.c
new file mode 100644
index 00000000..4a7a397e
--- /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
+ */