[clang] [Clang][Sema] Fix -Whigher-precision-for-complex-division (PR #131477)
Zahira Ammarguellat via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 8 07:06:00 PDT 2025
=?utf-8?q?Mészáros?= Gergely <maetveis at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/131477 at github.com>
================
@@ -10591,6 +10591,45 @@ static void checkArithmeticNull(Sema &S, ExprResult &LHS, ExprResult &RHS,
<< LHS.get()->getSourceRange() << RHS.get()->getSourceRange();
}
+static void DetectPrecisionLossInComplexDivision(Sema &S, QualType DivisorTy,
+ SourceLocation OpLoc) {
+ // If the divisor is real, then this is real/real or complex/real division.
+ // Either way there can be no precision loss.
+ auto *CT = DivisorTy->getAs<ComplexType>();
+ if (!CT)
+ return;
----------------
zahiraam wrote:
But that's only true if the target doesn't support higher precision types right? At this point this is not known.
https://github.com/llvm/llvm-project/pull/131477
More information about the cfe-commits
mailing list