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

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 31 10:25:37 PST 2025


================
@@ -1596,12 +1596,14 @@ QualType Sema::BuildQualifiedType(QualType T, SourceLocation Loc,
     QualType ProblemTy;
 
     if (T->isAnyPointerType() || T->isReferenceType() ||
-        T->isMemberPointerType()) {
+        T->isMemberPointerType() || T->isArrayType()) {
----------------
efriedma-quic wrote:

Don't you need some kind of recursion to check that the base element type ?  We don't want to allow `typedef int x[2]; typedef x restrict x2;`.  Or `typedef int (*x)(); typedef x x2[2]; typedef x2 restrict x3;`

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


More information about the cfe-commits mailing list