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

Yes, these are the kind of diagnostics we were looking for. The behavior around 
the error cases looks correct to me, but some of the warning diagnostics 
surprise me.

For example, this case is *not* an extension. C17 and before allowed restrict 
to apply only to pointers. A pointer to an array is a pointer, so that's always 
been supported: https://godbolt.org/z/Y8ccbrM36 So I don't think we should emit 
the diagnostics in this case.

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

Reply via email to