[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
Wed Feb 12 12:45:22 PST 2025


================
@@ -9,20 +9,20 @@ typedef int (*T)[2];
 restrict T x;
 
 typedef int *S[2];
-restrict S y; // expected-error {{restrict requires a pointer or reference ('S' (aka 'int *[2]') is invalid)}}
-
-
+restrict S y; // expected-warning {{'restrict' qualifier on an array of pointers is a C23 extension}}
 
 // int128_t is available.
 int a(void) {
   __int128_t s;
   __uint128_t t;
-}
+} // expected-warning {{non-void function does not return a value}}
+
 // but not a keyword
 int b(void) {
   int __int128_t;
   int __uint128_t;
-}
+} // expected-warning {{non-void function does not return a value}}
+
----------------
a-tarasyuk wrote:

@AaronBallman thanks, I've made changes to all the requested cases.


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


More information about the cfe-commits mailing list