[clang] [Clang][Sema] Prevent implicit casting Complex type to Vector (PR #187954)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 08:19:06 PDT 2026


================
@@ -13069,6 +13073,11 @@ void Sema::CheckImplicitConversion(Expr *E, QualType T, SourceLocation CC,
       if (SourceMgr.isInSystemMacro(CC) || Target->isBooleanType())
         return;
 
+      if (!getLangOpts().CPlusPlus && T->isVectorType()) {
----------------
erichkeane wrote:

Why is this only an error in C mode? Presumably this is a 'nicer' error message that we should use in both cases.

I suspect it is because the warning below allowing it as a warning?

Also, instead of `T`, we should match what everything else does and use `Target`. 

  

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


More information about the cfe-commits mailing list