forked from NetBSD/src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/lint: test trying to define a ()-less function
- Loading branch information
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
/* $NetBSD: msg_064.c,v 1.2 2021/02/21 09:07:58 rillig Exp $ */ | ||
/* $NetBSD: msg_064.c,v 1.3 2021/07/12 18:00:36 rillig Exp $ */ | ||
# 3 "msg_064.c" | ||
|
||
// Test for message: ()-less function definition [64] | ||
|
||
TODO: "Add example code that triggers the above message." /* expect: 249 */ | ||
TODO: "Add example code that almost triggers the above message." | ||
typedef int (function)(void); | ||
|
||
/* | ||
* Even though typedef_function has type function, this construction is not | ||
* allowed. A function definition must always look like a function | ||
* definition, and that includes the parentheses for the arguments or | ||
* parameters. | ||
*/ | ||
function typedef_function { | ||
/* expect-1: error: ()-less function definition [64] */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
msg_064.c(6): error: syntax error ':' [249] | ||
msg_064.c(14): error: ()-less function definition [64] |