xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_179.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: msg_179.c,v 1.4 2021/12/22 00:45:53 rillig Exp $	*/
2 # 3 "msg_179.c"
3 
4 // Test for message: cannot initialize struct/union with no named member [179]
5 
6 struct {
7 	unsigned int :0;
8 } no_named_member = {
9 	/* expect-1: error: cannot initialize struct/union with no named member [179] */
10 	/* no named member, therefore no initializer expression */
11 };
12 
13 struct {
14 	/* no members */
15 } empty = {
16 	/* expect-1: error: cannot initialize struct/union with no named member [179] */
17 	/* no initializer expressions */
18 };
19 
20 struct {
21 	unsigned int: 0;
22 } no_named_member_init = {
23 	/* expect-1: error: cannot initialize struct/union with no named member [179] */
24 	3,
25 };
26