msg_022.c revision 1.4
11.4Srillig/*	$NetBSD: msg_022.c,v 1.4 2022/04/05 23:09:19 rillig Exp $	*/
21.1Srillig# 3 "msg_022.c"
31.1Srillig
41.1Srillig// Test for message: incomplete or misplaced function definition [22]
51.1Srillig
61.3Srillig/*
71.3Srillig * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into
81.3Srillig * assertion failures after trying to recover from the below syntax error.
91.3Srillig */
101.3Srillig/* expect+1: error: syntax error 'f' [249] */
111.3Srilligunsigned long asdf = sizeof(int f() {});
121.3Srillig
131.3Srillig/* Give the parser a chance to recover. */
141.3Srillig/* expect+1: warning: empty declaration [0] */
151.3Srillig;
161.3Srillig
171.3Srillig/*
181.3Srillig * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into
191.3Srillig * assertion failures after trying to recover from the below syntax error.
201.3Srillig */
211.3Srillig/* expect+1: error: syntax error 'param1' [249] */
221.3Srilligunsigned long sz = sizeof(int(param1, param2));
231.3Srillig
241.3Srillig/* Give the parser a chance to recover. */
251.3Srillig/* expect+1: warning: empty declaration [0] */
261.3Srillig;
271.3Srillig
281.4Srillig/* expect+2: error: incomplete or misplaced function definition [22] */
291.4Srillig/* expect+1: warning: old style declaration; add 'int' [1] */
301.4Srilligold_style(arg);
31