brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 5395180 Raw
22 lines · c
1// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s2// RUN: %clang_cc1 -std=c17 -fsyntax-only -pedantic -verify=pedantic,expected %s3// RUN: %clang_cc1 -std=c2x -fsyntax-only -Wpre-c2x-compat -verify=c2x-compat,expected %s4 5typedef int (*T1)[2];6restrict T1 t1;7 8typedef int *T2[2];9restrict T2 t2;         // pedantic-warning {{'restrict' qualifier on an array of pointers is a C23 extension}} \10                        // c2x-compat-warning {{'restrict' qualifier on an array of pointers is incompatible with C standards before C23}}11 12typedef int *T3[2][2];13restrict T3 t3;         // pedantic-warning {{'restrict' qualifier on an array of pointers is a C23 extension}} \14                        // c2x-compat-warning {{'restrict' qualifier on an array of pointers is incompatible with C standards before C23}}15 16typedef int (*t4)();    // pedantic-warning {{a function declaration without a prototype is deprecated in all versions of C}}17typedef t4 t5[2];18typedef t5 restrict t6; // // expected-error-re {{pointer to function type 'int {{\((void)?\)}}' may not be 'restrict' qualified}}19 20typedef int t7[2];21typedef t7 restrict t8; // expected-error {{restrict requires a pointer or reference ('t7' (aka 'int[2]') is invalid)}}22