================
@@ -2279,6 +2280,20 @@ static bool CheckMaskedBuiltinArgs(Sema &S, Expr 
*MaskArg, Expr *PtrArg,
   if (!PtrTy->isPointerType() || PtrTy->getPointeeType()->isVectorType())
     return S.Diag(PtrArg->getExprLoc(), diag::err_vec_masked_load_store_ptr)
            << Pos << "scalar pointer";
+
+  QualType PointeeTy = PtrTy->getPointeeType();
+  if (PointeeTy.isVolatileQualified() || PointeeTy->isAtomicType() ||
+      (!AllowConst && PointeeTy.isConstQualified()) ||
+      (!AllowAS && PointeeTy.hasAddressSpace())) {
+    QualType Target = S.Context.getPointerType(PointeeTy.getUnqualifiedType());
+    if (const auto *AT = dyn_cast<AtomicType>(PointeeTy))
+      Target = S.Context.getPointerType(AT->getValueType());
----------------
rjmccall wrote:

`QualType Target = 
S.Context.getPointerType(PointeeTy.getAtomicUnqualifiedType());`

https://github.com/llvm/llvm-project/pull/160185
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to