msg_022.c revision 1.5
1/*	$NetBSD: msg_022.c,v 1.5 2022/10/01 09:42:40 rillig Exp $	*/
2# 3 "msg_022.c"
3
4// Test for message: incomplete or misplaced function definition [22]
5
6/*
7 * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into
8 * assertion failures after trying to recover from the below syntax error.
9 */
10/* expect+1: error: syntax error 'f' [249] */
11unsigned long asdf = sizeof(int f() {});
12
13/* Give the parser a chance to recover. */
14/* expect+1: warning: empty declaration [0] */
15;
16
17/*
18 * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into
19 * assertion failures after trying to recover from the below syntax error.
20 */
21/* expect+1: error: syntax error 'param1' [249] */
22unsigned long sz = sizeof(int(param1, param2));
23
24/* Give the parser a chance to recover. */
25/* expect+1: warning: empty declaration [0] */
26;
27
28/* expect+2: error: incomplete or misplaced function definition [22] */
29/* expect+1: warning: old-style declaration; add 'int' [1] */
30old_style(arg);
31