Skip to content

Conversation

@slackito
Copy link
Collaborator

@slackito slackito commented Mar 1, 2025

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.

cpp::is_complex_type_same<T1, T2> is a function, so we need parentheses
in order to call it.
@llvmbot llvmbot added the libc label Mar 1, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 1, 2025

@llvm/pr-subscribers-libc

Author: Jorge Gorbe Moya (slackito)

Changes

cpp::is_complex_type_same&lt;T1, T2&gt; 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.


Full diff: https://github.com/llvm/llvm-project/pull/129349.diff

1 Files Affected:

  • (modified) libc/utils/MPCWrapper/MPCUtils.h (+2-2)
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 &&

@lntue lntue merged commit 6209533 into llvm:main Mar 1, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants