/* $NetBSD: c11.c,v 1.2 2023/07/12 18:26:04 rillig Exp $ */ # 3 "c11.c" /* * Test the language level C11, which adds _Generic expressions, _Noreturn * functions, anonymous struct/union members, and several more. */ /* lint1-flags: -Ac11 -w -X 236 -X 351 */ _Noreturn void exit(int); void _Noreturn exit(int); _Noreturn void noreturn_before_type(void) { exit(0); } void _Noreturn noreturn_after_type(void) { exit(0); } static _Noreturn void noreturn_after_storage_class(void) { exit(0); } _Noreturn static void noreturn_before_storage_class(void) { exit(0); } /* C11 6.7.4p5: A function specifier may appear more than once. */ _Noreturn _Noreturn _Noreturn void three_times(void) { exit(0); } /* The '_Noreturn' must not appear after the declarator. */ void _Noreturn exit(int) _Noreturn; /* expect-1: error: formal parameter #1 lacks name [59] */ /* expect-2: warning: empty declaration [2] */ /* expect+2: error: syntax error '' [249] */ /* expect+1: error: cannot recover from previous errors [224] */