36 lines · c
1// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic %s2// RUN: %clang_cc1 -verify -Wall -pedantic %s3 4/* WG14 N3344: Yes5 * Slay Some Earthly Demons VI6 *7 * A 'void' parameter cannot have any qualifiers, storage class specifiers, or8 * be followed by an ellipsis.9 *10 * Note: Clang treats 'register void' as being a DR and rejects it in all11 * language modes; there's no evidence that this will break users and it's not12 * clear what the programmer intended if they wrote such code anyway. This13 * matches GCC's behavior.14 */15 16void baz(volatile void); // expected-error {{'void' as parameter must not have type qualifiers}}17void bar(const void); // expected-error {{'void' as parameter must not have type qualifiers}}18void foo(register void); // expected-error {{invalid storage class specifier in function declarator}}19void foop(void register); // expected-error {{invalid storage class specifier in function declarator}}20void quux(static void); // expected-error {{invalid storage class specifier in function declarator}}21void quobble(auto void); // expected-error {{invalid storage class specifier in function declarator}}22void quubble(extern void); // expected-error {{invalid storage class specifier in function declarator}}23// FIXME: it's odd that these aren't diagnosed as storage class specifiers.24#if __STDC_VERSION__ >= 202311L25void quibble(constexpr void); // expected-error {{function parameter cannot be constexpr}}26#endif27#if __STDC_VERSION__ >= 201112L28void quabble(_Thread_local void); // expected-error {{'_Thread_local' is only allowed on variable declarations}}29#endif30void bing(void, ...); // expected-error {{'void' must be the first and only parameter if specified}}31 32// These declarations are fine.33void one(register void *);34void two(void register *);35void three(register void * (*)[4]);36