Module Name: src
Committed By: rillig
Date: Fri Jun 16 11:58:33 UTC 2023
Modified Files:
src/tests/usr.bin/indent: lsym_typedef.c
Log Message:
tests/indent: demonstrate wrong tokenization after typedef
Since 2023-06-10 06:52, which fixed the indentation of C11 _Generic
expressions.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/lsym_typedef.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/indent/lsym_typedef.c
diff -u src/tests/usr.bin/indent/lsym_typedef.c:1.6 src/tests/usr.bin/indent/lsym_typedef.c:1.7
--- src/tests/usr.bin/indent/lsym_typedef.c:1.6 Sun Apr 24 10:36:37 2022
+++ src/tests/usr.bin/indent/lsym_typedef.c Fri Jun 16 11:58:33 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_typedef.c,v 1.6 2022/04/24 10:36:37 rillig Exp $ */
+/* $NetBSD: lsym_typedef.c,v 1.7 2023/06/16 11:58:33 rillig Exp $ */
/*
* Tests for the token lsym_typedef, which represents the keyword 'typedef'
@@ -59,3 +59,25 @@ typedef int number;
//indent end
//indent run-equals-input
+
+
+/*
+ * Ensure that a typedef declaration does not introduce an unnecessary line
+ * break after the '}'.
+ */
+//indent input
+typedef struct {
+ int member;
+ bool bit:1;
+} typedef_name;
+//indent end
+
+//indent run -di0
+typedef struct {
+ int member;
+// $ FIXME: No space after the ':' here.
+ bool bit: 1;
+}
+// $ FIXME: No linebreak here.
+typedef_name;
+//indent end