Thu Jul 8 20:11:15 2021 UTC ()
tests/lint: test error recovery of the parser


(rillig)
diff -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_249.c

cvs diff -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_249.c (expand / switch to context diff)
--- src/tests/usr.bin/xlint/lint1/msg_249.c 2021/07/08 18:02:22 1.4
+++ src/tests/usr.bin/xlint/lint1/msg_249.c 2021/07/08 20:11:15 1.5
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_249.c,v 1.4 2021/07/08 18:02:22 rillig Exp $	*/
+/*	$NetBSD: msg_249.c,v 1.5 2021/07/08 20:11:15 rillig Exp $	*/
 # 3 "msg_249.c"
 
 // Test for message: syntax error '%s' [249]
@@ -33,5 +33,15 @@
 	);			/* expect: syntax error ')' */
 }
 
+/* XXX: It is unexpected that this error is not detected. */
+"This syntax error is not detected.";
+
 /* XXX: This is necessary to recover the yacc parser. */
-int recover_from_rparen;
+double recover_from_rparen;
+
+/* Ensure that the declaration after the syntax error is processed. */
+double *
+access_declaration_after_syntax_error(void)
+{
+	return &recover_from_rparen;
+}