Module Name: src Committed By: rillig Date: Thu Jul 8 20:11:15 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_249.c Log Message: tests/lint: test error recovery of the parser To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_249.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_249.c diff -u src/tests/usr.bin/xlint/lint1/msg_249.c:1.4 src/tests/usr.bin/xlint/lint1/msg_249.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_249.c:1.4 Thu Jul 8 18:02:22 2021 +++ src/tests/usr.bin/xlint/lint1/msg_249.c Thu Jul 8 20:11:15 2021 @@ -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 @@ function(void) ); /* 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; +}