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

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 25 13:11:33 PDT 2025


================
@@ -2373,6 +2402,7 @@ static ExprResult BuiltinMaskedGather(Sema &S, CallExpr *TheCall) {
                TheCall->getBuiltinCallee())
         << MaskTy << IdxTy);
 
+  PointeeTy.removeLocalConst();
----------------
rjmccall wrote:

A "local" const qualifier is one that's written directly on a type, which means that this doesn't remove local qualifiers that are written in type sugar, e.g. if the argument is a pointer to a typedef of const int. It's usually not correct for Sema to ever do something only for local qualifiers.

In this case, you definitely want the fully-unqualified pointee type, because the element type of a vector type is not allowed to be qualified at all.

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


More information about the cfe-commits mailing list