[clang] afc41b9 - [clang][bytecode] Fix implicit-cast-complex-to-vector test (#191662)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 11 23:41:18 PDT 2026
Author: Timm Baeder
Date: 2026-04-12T08:41:14+02:00
New Revision: afc41b904180af0cc56eeec8bdb201ce880627f9
URL: https://github.com/llvm/llvm-project/commit/afc41b904180af0cc56eeec8bdb201ce880627f9
DIFF: https://github.com/llvm/llvm-project/commit/afc41b904180af0cc56eeec8bdb201ce880627f9.diff
LOG: [clang][bytecode] Fix implicit-cast-complex-to-vector test (#191662)
Added:
Modified:
clang/lib/AST/ByteCode/Compiler.cpp
clang/test/Sema/implicit-cast-complex-to-vector.c
Removed:
################################################################################
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 4f517266336f2..15651b9de9e91 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -703,9 +703,11 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *E) {
case CK_VectorSplat: {
assert(!canClassify(E->getType()));
- assert(canClassify(SubExpr->getType()));
assert(E->getType()->isVectorType());
+ if (!canClassify(SubExpr->getType()))
+ return false;
+
if (!Initializing) {
UnsignedOrNone LocalIndex = allocateLocal(E);
if (!LocalIndex)
diff --git a/clang/test/Sema/implicit-cast-complex-to-vector.c b/clang/test/Sema/implicit-cast-complex-to-vector.c
index 4b91c96c6f34e..279bc60d69b68 100644
--- a/clang/test/Sema/implicit-cast-complex-to-vector.c
+++ b/clang/test/Sema/implicit-cast-complex-to-vector.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify=c %s
+// RUN: %clang_cc1 -fsyntax-only -verify=c %s -fexperimental-new-constant-interpreter
// RUN: %clang_cc1 -x c++ -fsyntax-only -verify=cxx %s
typedef char __attribute__((__vector_size__(64))) V;
More information about the cfe-commits
mailing list