Module Name: src
Committed By: rillig
Date: Mon Jul 31 20:52:26 UTC 2023
Modified Files:
src/tests/usr.bin/xlint/lint1: decl.c
Log Message:
tests/lint: test symbol lookup in unnamed bit-field member declaration
To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/xlint/lint1/decl.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/decl.c
diff -u src/tests/usr.bin/xlint/lint1/decl.c:1.24 src/tests/usr.bin/xlint/lint1/decl.c:1.25
--- src/tests/usr.bin/xlint/lint1/decl.c:1.24 Mon Jul 31 20:31:58 2023
+++ src/tests/usr.bin/xlint/lint1/decl.c Mon Jul 31 20:52:26 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.24 2023/07/31 20:31:58 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.25 2023/07/31 20:52:26 rillig Exp $ */
# 3 "decl.c"
/*
@@ -211,3 +211,21 @@ bit_and_data(struct bit_and_data *node)
{
return node->data;
}
+
+
+// See cgram.y, rule 'notype_member_declarator'.
+void
+symbol_type_in_unnamed_bit_field_member(void)
+{
+ enum {
+ bits = 4,
+ };
+
+ struct s {
+ // Since there is no name in the declarator, the next symbol
+ // after the ':' must not be interpreted as a member name, but
+ // instead as a variable, type or function (FVFT).
+ unsigned int :bits;
+ int named_member;
+ };
+}