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

via libc-commits libc-commits at lists.llvm.org
Fri Feb 28 19:40:46 PST 2025


Author: Jorge Gorbe Moya
Date: 2025-02-28T22:40:43-05:00
New Revision: 620953328dc768ef6b205077214a01ae0579975c

URL: https://github.com/llvm/llvm-project/commit/620953328dc768ef6b205077214a01ae0579975c
DIFF: https://github.com/llvm/llvm-project/commit/620953328dc768ef6b205077214a01ae0579975c.diff

LOG: [libc] Fix warning in libc/utils/MPCWrapper/MPCUtils.h (#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.

Added: 
    

Modified: 
    libc/utils/MPCWrapper/MPCUtils.h

Removed: 
    


################################################################################
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