[clang] [Clang] allow restrict qualifier for array types with pointer types as element types (PR #120896)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 03:50:18 PST 2025


================
@@ -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}} \
----------------
a-tarasyuk wrote:

@efriedma-quic @AaronBallman were you referring to the following warning/extension diagnostics? Should these kinds of diagnostics be considered in cases where errors occur?




https://github.com/llvm/llvm-project/pull/120896


More information about the cfe-commits mailing list