1 /* $NetBSD: msg_145.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ 2 # 3 "msg_145.c" 3 4 // Test for message: cannot take size/alignment of bit-field [145] 5 6 struct bits { 7 unsigned one: 1; 8 unsigned eight: 8; 9 }; 10 11 unsigned long 12 sizeof_one(void) 13 { 14 struct bits local_bits; 15 16 /* expect+1: error: cannot take size/alignment of bit-field [145] */ 17 return sizeof(local_bits.one); 18 } 19 20 unsigned long 21 sizeof_eight(void) 22 { 23 struct bits local_bits; 24 25 /* expect+1: error: cannot take size/alignment of bit-field [145] */ 26 return sizeof(local_bits.eight); 27 } 28