xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_114.c (revision e6298b924c5ba98f3a22919b56dab04a87cdbb1c)
1 /*	$NetBSD: msg_114.c,v 1.7 2023/07/07 19:45:22 rillig Exp $	*/
2 # 3 "msg_114.c"
3 
4 // Test for message: %soperand of '%s' must be lvalue [114]
5 
6 /* lint1-extra-flags: -X 351 */
7 
8 /* ARGSUSED */
9 void
example(int a)10 example(int a)
11 {
12 	/* expect+1: error: operand of 'x++' must be lvalue [114] */
13 	3++;
14 
15 	/*
16 	 * Before tree.c 1.137 from 2021-01-09, trying to increment an array
17 	 * aborted lint with 'common/tyname.c, 190: tspec_name(0)'.
18 	 *
19 	 * See msg_108.c for more details.
20 	 */
21 	/* expect+1: error: operand of 'x++' has invalid type 'array[7] of char' [108] */
22 	"string"++;
23 
24 	/* expect+1: error: operand of 'x++' must be lvalue [114] */
25 	(a + a)++;
26 }
27