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: demonstrate that _Gene...
details: https://anonhg.NetBSD.org/src/rev/de8da5cdbdd6
branches: trunk
changeset: 984564:de8da5cdbdd6
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jul 11 20:34:05 2021 +0000
description:
tests/lint: demonstrate that _Generic must be a primary_expression
diffstat:
tests/usr.bin/xlint/lint1/c11_generic_expression.c | 10 +++++++++-
tests/usr.bin/xlint/lint1/c11_generic_expression.exp | 2 ++
2 files changed, 11 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r 1819d43277cd -r de8da5cdbdd6 tests/usr.bin/xlint/lint1/c11_generic_expression.c
--- a/tests/usr.bin/xlint/lint1/c11_generic_expression.c Sun Jul 11 20:25:54 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.c Sun Jul 11 20:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: c11_generic_expression.c,v 1.6 2021/06/28 07:55:05 rillig Exp $ */
+/* $NetBSD: c11_generic_expression.c,v 1.7 2021/07/11 20:34:05 rillig Exp $ */
# 3 "c11_generic_expression.c"
/*
@@ -88,3 +88,11 @@
int: second = first
);
}
+
+int
+primary_expression(void)
+{
+ /*FIXME*//* expect+1: syntax error '(' [249] */
+ return _Generic(0, int: assignment_expression)(0, 0);
+}
+/* expect-1: falls off */
diff -r 1819d43277cd -r de8da5cdbdd6 tests/usr.bin/xlint/lint1/c11_generic_expression.exp
--- a/tests/usr.bin/xlint/lint1/c11_generic_expression.exp Sun Jul 11 20:25:54 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.exp Sun Jul 11 20:34:05 2021 +0000
@@ -4,3 +4,5 @@
c11_generic_expression.c(53): warning: argument 'c' unused in function 'classify_char' [231]
c11_generic_expression.c(72): error: syntax error 'second' [249]
c11_generic_expression.c(77): warning: function comma_expression falls off bottom without returning value [217]
+c11_generic_expression.c(96): error: syntax error '(' [249]
+c11_generic_expression.c(97): warning: function primary_expression falls off bottom without returning value [217]
Home |
Main Index |
Thread Index |
Old Index