[libc-commits] [libc] [libc] Fix warning in libc/utils/MPCWrapper/MPCUtils.h (PR #129349)

Jorge Gorbe Moya via libc-commits libc-commits at lists.llvm.org
Fri Feb 28 18:45:30 PST 2025


https://github.com/slackito created https://github.com/llvm/llvm-project/pull/129349

`cpp::is_complex_type_same<T1, T2>` is a function, so we need parentheses in order to call it. Otherwise the expression is treated like a function pointer which is always true in this boolean context.

>From a1eba681ed2a3f4f13d8594a01b19c7bd8c451d4 Mon Sep 17 00:00:00 2001
From: Jorge Gorbe Moya <jgorbe at google.com>
Date: Fri, 28 Feb 2025 18:40:15 -0800
Subject: [PATCH] [libc] Fix warning in libc/utils/MPCWrapper/MPCUtils.h

cpp::is_complex_type_same<T1, T2> is a function, so we need parentheses
in order to call it.
---
 libc/utils/MPCWrapper/MPCUtils.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libc/utils/MPCWrapper/MPCUtils.h b/libc/utils/MPCWrapper/MPCUtils.h
index d141b4d986920..d4c57240c751c 100644
--- a/libc/utils/MPCWrapper/MPCUtils.h
+++ b/libc/utils/MPCWrapper/MPCUtils.h
@@ -174,11 +174,11 @@ template <Operation op, typename InputType, typename OutputType>
 constexpr bool is_valid_operation() {
   return (Operation::BeginBinaryOperationsSingleOutput < op &&
           op < Operation::EndBinaryOperationsSingleOutput &&
-          cpp::is_complex_type_same<InputType, OutputType> &&
+          cpp::is_complex_type_same<InputType, OutputType>() &&
           cpp::is_complex_v<InputType>) ||
          (Operation::BeginUnaryOperationsSingleOutputSameOutputType < op &&
           op < Operation::EndUnaryOperationsSingleOutputSameOutputType &&
-          cpp::is_complex_type_same<InputType, OutputType> &&
+          cpp::is_complex_type_same<InputType, OutputType>() &&
           cpp::is_complex_v<InputType>) ||
          (Operation::BeginUnaryOperationsSingleOutputDifferentOutputType < op &&
           op < Operation::EndUnaryOperationsSingleOutputDifferentOutputType &&



More information about the libc-commits mailing list