[clang] [clang] Reject references to vector types in `__builtin_vectorelements` (PR #219767)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 9 07:56:09 PDT 2026
================
@@ -4742,6 +4742,12 @@ bool Sema::CheckUnaryExprOrTypeTraitOperand(QualType ExprType,
if (ExprType->isDependentType())
return false;
+ // A reference to a vector type is not a vector type; check this before the
+ // reference is looked through below.
+ if (ExprKind == UETT_VectorElements)
+ return CheckVectorElementsTraitOperandType(*this, ExprType, OpLoc,
----------------
erichkeane wrote:
Can you fix them here too? And write tests? It would be nice to fix all at once, particularly since the 'fix' is so trivial.
https://github.com/llvm/llvm-project/pull/219767
More information about the cfe-commits
mailing list