================ @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -std=c23 -fsyntax-only -verify %s +// RUN: %clang_cc1 -std=c17 -fsyntax-only -pedantic -verify=pedantic %s +// RUN: %clang_cc1 -std=c17 -fsyntax-only -Wpre-c2x-compat -verify=pre-c2x-compat %s + +typedef int (*T1)[2]; +restrict T1 t1; // pedantic-warning {{'restrict' qualifier on pointers to arrays is a C23 extension}} \ + // pre-c2x-compat-warning {{'restrict' qualifier on pointers to arrays is incompatible with C17 and earlier}} + +typedef int *T2[2]; +restrict T2 t2; // pedantic-warning {{'restrict' qualifier on pointers to arrays is a C23 extension}} \ ---------------- AaronBallman wrote:
This diagnostic wording is incorrect: it's not a pointer to an array, it's an array of pointers. The diagnostic firing on this code is correct, however. https://github.com/llvm/llvm-project/pull/120896 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits