[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
Mon Feb 3 05:53:00 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()) {
       QualType EltTy;
       if (T->isObjCObjectPointerType())
         EltTy = T;
       else if (const MemberPointerType *PTy = T->getAs<MemberPointerType>())
         EltTy = PTy->getPointeeType();
+      else if (T->isArrayType())
+        EltTy = BuildQualifiedType(Context.getBaseElementType(T), Loc, Qs);
----------------
a-tarasyuk wrote:

@efriedma-quic I've moved `getBaseElementType`

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


More information about the cfe-commits mailing list