Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: try harder to reduce '...



details:   https://anonhg.NetBSD.org/src/rev/04466a2b610b
branches:  trunk
changeset: 984834:04466a2b610b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 25 09:53:01 2021 +0000

description:
tests/lint: try harder to reduce 'abstract_declarator: T_TYPEOF'

At the top level of a type_name, declaration-specifiers take precedence,
but these cannot look inside the parentheses of a
direct-abstract-declarator.

diffstat:

 tests/usr.bin/xlint/lint1/parse_type_name.c   |  12 ++----------
 tests/usr.bin/xlint/lint1/parse_type_name.exp |  11 +++++------
 2 files changed, 7 insertions(+), 16 deletions(-)

diffs (42 lines):

diff -r 60a442595dac -r 04466a2b610b tests/usr.bin/xlint/lint1/parse_type_name.c
--- a/tests/usr.bin/xlint/lint1/parse_type_name.c       Sun Jul 25 09:47:08 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/parse_type_name.c       Sun Jul 25 09:53:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse_type_name.c,v 1.2 2021/07/25 09:47:08 rillig Exp $       */
+/*     $NetBSD: parse_type_name.c,v 1.3 2021/07/25 09:53:01 rillig Exp $       */
 # 3 "parse_type_name.c"
 
 /*
@@ -48,15 +48,7 @@
        sink(sizeof(int **[3]));
 
        /* cover 'T_TYPEOF cast_expression' */
-       sink(sizeof(typeof(12345)));
-       /* expect+1: error: illegal type combination [4] */
-       sink(sizeof(typeof(12345) typeof(12345)));
-       /*
-        * TODO: Remove this grammar rule.  No matter how often typeof occurs
-        * in the expression, it is already covered by abstract_declaration >
-        * begin_type_specifier_qualifier_list > begin_type_typespec >
-        * notype_type_specifier > T_TYPEOF.  It can never reduce this rule.
-        */
+       sink(sizeof(int(typeof(12345))));
 }
 
 void
diff -r 60a442595dac -r 04466a2b610b tests/usr.bin/xlint/lint1/parse_type_name.exp
--- a/tests/usr.bin/xlint/lint1/parse_type_name.exp     Sun Jul 25 09:47:08 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/parse_type_name.exp     Sun Jul 25 09:53:01 2021 +0000
@@ -1,7 +1,6 @@
-parse_type_name.c(53): error: illegal type combination [4]
-parse_type_name.c(79): error: null dimension [17]
-parse_type_name.c(83): error: null dimension [17]
+parse_type_name.c(71): error: null dimension [17]
+parse_type_name.c(75): error: null dimension [17]
+parse_type_name.c(141): error: syntax error 'goto' [249]
+parse_type_name.c(143): error: syntax error 'goto' [249]
 parse_type_name.c(149): error: syntax error 'goto' [249]
-parse_type_name.c(151): error: syntax error 'goto' [249]
-parse_type_name.c(157): error: syntax error 'goto' [249]
-parse_type_name.c(171): warning: ANSI C requires formal parameter before '...' [84]
+parse_type_name.c(163): warning: ANSI C requires formal parameter before '...' [84]



Home | Main Index | Thread Index | Old Index