tests/lint: parse error for unused variable (since 2021-07-10) Since cgram.y 1.294 from 2021-07-10.diff -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/decl.c
(rillig)
--- src/tests/usr.bin/xlint/lint1/decl.c 2021/07/10 19:30:19 1.2
+++ src/tests/usr.bin/xlint/lint1/decl.c 2021/07/11 12:12:30 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: decl.c,v 1.2 2021/07/10 19:30:19 rillig Exp $ */ | 1 | /* $NetBSD: decl.c,v 1.3 2021/07/11 12:12:30 rillig Exp $ */ | |
2 | # 3 "decl.c" | 2 | # 3 "decl.c" | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Tests for declarations, especially the distinction between the | 5 | * Tests for declarations, especially the distinction between the | |
6 | * declaration-specifiers and the declarators. | 6 | * declaration-specifiers and the declarators. | |
7 | */ | 7 | */ | |
8 | 8 | |||
9 | /* | 9 | /* | |
10 | * Even though 'const' comes after 'char' and is therefore quite close to the | 10 | * Even though 'const' comes after 'char' and is therefore quite close to the | |
11 | * first identifier, it applies to both identifiers. | 11 | * first identifier, it applies to both identifiers. | |
12 | */ | 12 | */ | |
13 | void | 13 | void | |
14 | specifier_qualifier(void) | 14 | specifier_qualifier(void) | |
@@ -76,13 +76,25 @@ _Bool | @@ -76,13 +76,25 @@ _Bool | |||
76 | enum_error_handling(void) | 76 | enum_error_handling(void) | |
77 | { | 77 | { | |
78 | enum { | 78 | enum { | |
79 | /* expect+1: syntax error '"' [249] */ | 79 | /* expect+1: syntax error '"' [249] */ | |
80 | "error 1" | 80 | "error 1" | |
81 | : /* still the same error */ | 81 | : /* still the same error */ | |
82 | , /* back on track */ | 82 | , /* back on track */ | |
83 | A, | 83 | A, | |
84 | B | 84 | B | |
85 | } x = A; | 85 | } x = A; | |
86 | 86 | |||
87 | return x == B; | 87 | return x == B; | |
88 | } | 88 | } | |
89 | ||||
90 | void | |||
91 | unused_local_variable(void) | |||
92 | { | |||
93 | /*FIXME*//* expect+1: syntax error '_Bool' [249] */ | |||
94 | __attribute__((unused)) _Bool unused_var; | |||
95 | ||||
96 | __attribute__((unused)) | |||
97 | /*FIXME*//* expect+2: syntax error '__attribute__' [249] */ | |||
98 | /*FIXME*//* expect+1: cannot recover from previous errors [224] */ | |||
99 | __attribute__((unused)) _Bool unused_twice; | |||
100 | } |
--- src/tests/usr.bin/xlint/lint1/Attic/decl.exp 2021/07/10 19:30:19 1.2
+++ src/tests/usr.bin/xlint/lint1/Attic/decl.exp 2021/07/11 12:12:30 1.3
@@ -1,11 +1,14 @@ | @@ -1,11 +1,14 @@ | |||
1 | decl.c(19): warning: left operand of '=' must be modifiable lvalue [115] | 1 | decl.c(19): warning: left operand of '=' must be modifiable lvalue [115] | |
2 | decl.c(21): warning: left operand of '=' must be modifiable lvalue [115] | 2 | decl.c(21): warning: left operand of '=' must be modifiable lvalue [115] | |
3 | decl.c(34): warning: left operand of '=' must be modifiable lvalue [115] | 3 | decl.c(34): warning: left operand of '=' must be modifiable lvalue [115] | |
4 | decl.c(36): warning: left operand of '=' must be modifiable lvalue [115] | 4 | decl.c(36): warning: left operand of '=' must be modifiable lvalue [115] | |
5 | decl.c(43): error: syntax error 'const' [249] | 5 | decl.c(43): error: syntax error 'const' [249] | |
6 | decl.c(47): error: 'b' undefined [99] | 6 | decl.c(47): error: 'b' undefined [99] | |
7 | decl.c(54): error: syntax error 'const' [249] | 7 | decl.c(54): error: syntax error 'const' [249] | |
8 | decl.c(68): warning: converting 'pointer to char' to incompatible 'pointer to double' for argument 1 [153] | 8 | decl.c(68): warning: converting 'pointer to char' to incompatible 'pointer to double' for argument 1 [153] | |
9 | decl.c(70): warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154] | 9 | decl.c(70): warning: illegal combination of pointer (pointer to double) and integer (char), arg #1 [154] | |
10 | decl.c(72): warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153] | 10 | decl.c(72): warning: converting 'pointer to pointer to char' to incompatible 'pointer to double' for argument 1 [153] | |
11 | decl.c(80): error: syntax error '"' [249] | 11 | decl.c(80): error: syntax error '"' [249] | |
12 | decl.c(94): error: syntax error '_Bool' [249] | |||
13 | decl.c(99): error: syntax error '__attribute__' [249] | |||
14 | decl.c(99): error: cannot recover from previous errors [224] |