xref: /netbsd-src/tests/usr.bin/xlint/lint1/d_cast_typeof.c (revision b2baa50111d645353fa30b4deab0f79d93650c8c)
1 /*	$NetBSD: d_cast_typeof.c,v 1.4 2023/03/28 14:44:34 rillig Exp $	*/
2 # 3 "d_cast_typeof.c"
3 
4 /* lint1-extra-flags: -X 351 */
5 
6 struct foo {
7 	char list;
8 };
9 struct foo *hole;
10 
11 char *
foo(void)12 foo(void)
13 {
14 	return hole ?
15 	    ((char *)&((typeof(hole))0)->list) :
16 	    ((char *)&((typeof(*hole) *)0)->list);
17 }
18