Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/indent tests/indent: demonstrate 'sizeof(int) ...



details:   https://anonhg.NetBSD.org/src/rev/41eddb6c5cca
branches:  trunk
changeset: 1026462:41eddb6c5cca
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Nov 25 18:10:23 2021 +0000

description:
tests/indent: demonstrate 'sizeof(int) *expr' (since 2021-11-25)

Broken in indent-2021.11.25.16.41.33, while fixing the spacing around
'*' in declarations.

diffstat:

 tests/usr.bin/indent/lsym_sizeof.c |  18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 18076a638d1b -r 41eddb6c5cca tests/usr.bin/indent/lsym_sizeof.c
--- a/tests/usr.bin/indent/lsym_sizeof.c        Thu Nov 25 17:50:00 2021 +0000
+++ b/tests/usr.bin/indent/lsym_sizeof.c        Thu Nov 25 18:10:23 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lsym_sizeof.c,v 1.1 2021/11/18 21:19:19 rillig Exp $ */
+/* $NetBSD: lsym_sizeof.c,v 1.2 2021/11/25 18:10:23 rillig Exp $ */
 /* $FreeBSD$ */
 
 /*
@@ -15,3 +15,19 @@
 #indent end
 
 #indent run-equals-input
+
+
+/*
+ * After 'sizeof', a type name in parentheses does not start a cast
+ * expression.
+ *
+ * Broken since lexi.c 1.156 from 2021-11-25.
+ */
+#indent input
+char str[sizeof(int) * CHAR_BIT + 1];
+#indent end
+
+/* FIXME: The '*' must be a binary operator here. */
+#indent run -di0
+char str[sizeof(int) *CHAR_BIT + 1];
+#indent end



Home | Main Index | Thread Index | Old Index