[clang] [Sema] built-in args type checking using hasSameUnqualifiedType (PR #141485)
via cfe-commits
cfe-commits at lists.llvm.org
Wed May 28 21:57:15 PDT 2025
================
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+// expected-no-diagnostics
+
+// This example uncovered a bug in Sema::BuiltinVectorMath, where we should be
+// using ASTContext::hasSameUnqualifiedType().
+
+typedef float vec3 __attribute__((ext_vector_type(3)));
+
+typedef struct {
+ vec3 b;
+} struc;
+
+vec3 foo(vec3 a,const struc* hi) {
+ vec3 b = __builtin_elementwise_max((vec3)(0.0f), a);
----------------
QiYueFeiXue wrote:
I think other builtins may have similar issues, but I tested them locally and they don't seem to be the case. I will roll back other irrelevant changes later.
https://github.com/llvm/llvm-project/pull/141485
More information about the cfe-commits
mailing list