[clang] [Clang][FIX] Fix type qualifiers on vector builtins (PR #160185)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 22 14:50:36 PDT 2025


================
@@ -2428,6 +2435,11 @@ static ExprResult BuiltinMaskedScatter(Sema &S, CallExpr *TheCall) {
   QualType PtrTy = PtrArg->getType();
   QualType PointeeTy = PtrTy->getPointeeType();
 
+  if (PtrTy->getPointeeType().isConstQualified())
+    return ExprError(
+        S.Diag(PtrArg->getExprLoc(), diag::err_typecheck_assign_const)
+        << /*read-only*/ 5);
----------------
jhuber6 wrote:

I meant that it would probably propagate to the intrinsic's use https://godbolt.org/z/WxK3dzK56. I don't think it's mandatory that the qualifiers all match and the only qualifier that makes a big difference is const AFAIK.

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


More information about the cfe-commits mailing list