| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify=c2x -std=c2x %s |
| 2 |
// RUN: %clang_cc1 -Wno-strict-prototypes -fsyntax-only -verify -std=c17 %s |
| 3 |
// expected-no-diagnostics |
| 4 |
|
| 5 |
// Functions with an identifier list are not supported in C23. |
| 6 |
void ident_list(a) // c2x-error {{expected ';' after top level declarator}} \ |
| 7 |
c2x-error {{unknown type name 'a'}} |
| 8 |
int a; |
| 9 |
{} // c2x-error {{expected identifier or '('}} |
| 10 |
|
| 11 |
// Functions with an empty parameter list are supported as though the function |
| 12 |
// was declared with a parameter list of (void). Ensure they still parse. |
| 13 |
void no_param_decl(); |
| 14 |
void no_param_defn() {} |
| 15 |
void (*var_of_type_with_no_param)(); |
| 16 |
typedef void fn(); |