From f81df4b8d9063d0da05df88f3254ed28ae8f17ca Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 30 Jul 2008 13:51:50 +0000 Subject: [PATCH] pointer arithmetic only allowed with object types [r20809] --- parsetest/shouldfail/pointerarith.c | 5 +++++ parsetest/shouldfail/pointerarith2.c | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 parsetest/shouldfail/pointerarith.c create mode 100644 parsetest/shouldfail/pointerarith2.c diff --git a/parsetest/shouldfail/pointerarith.c b/parsetest/shouldfail/pointerarith.c new file mode 100644 index 0000000..1b54bd1 --- /dev/null +++ b/parsetest/shouldfail/pointerarith.c @@ -0,0 +1,5 @@ +int main(void) { + void *a = 0; + a += 5; + return 0; +} diff --git a/parsetest/shouldfail/pointerarith2.c b/parsetest/shouldfail/pointerarith2.c new file mode 100644 index 0000000..bb13533 --- /dev/null +++ b/parsetest/shouldfail/pointerarith2.c @@ -0,0 +1,5 @@ +int main(void) { + int (*a)(void) = main; + a += 2; + return 0; +} -- 2.20.1