Skip to content

Conversation

xlauko
Copy link
Contributor

@xlauko xlauko commented Sep 30, 2025

This fixes macos build, where otherwise the compilation yields an error: no viable conversion from 'bool' to 'typename iterator_traits<const QualType *>::value_type

This fixes macos build, where otherwise the compilation yields an error: `no viable conversion from 'bool' to 'typename iterator_traits<const QualType *>::value_type`
@xlauko
Copy link
Contributor Author

xlauko commented Sep 30, 2025

@xlauko xlauko marked this pull request as ready for review September 30, 2025 19:57
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Sep 30, 2025
@xlauko xlauko requested a review from erichkeane September 30, 2025 19:58
@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2025

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Henrich Lauko (xlauko)

Changes

This fixes macos build, where otherwise the compilation yields an error: no viable conversion from 'bool' to 'typename iterator_traits&lt;const QualType *&gt;::value_type


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

1 Files Affected:

  • (modified) clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp (+1-1)
diff --git a/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp b/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
index e41c2d85fbd5d..fc28ac552224c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
@@ -89,7 +89,7 @@ mlir::Value OpenACCRecipeBuilderBase::makeBoundsAlloca(
   std::transform_inclusive_scan(
       resultTypes.begin(), resultTypes.end(),
       std::back_inserter(allocasLeftArr), std::plus<bool>{},
-      [](QualType ty) { return !ty->isConstantArrayType(); });
+      [](QualType ty) { return !ty->isConstantArrayType(); }, false);
 
   // Keep track of the number of 'elements' that we're allocating. Individual
   // allocas should multiply this by the size of its current allocation.

resultTypes.begin(), resultTypes.end(),
std::back_inserter(allocasLeftArr), std::plus<bool>{},
[](QualType ty) { return !ty->isConstantArrayType(); });
[](QualType ty) { return !ty->isConstantArrayType(); }, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, looks like someone's library is missing overload 1 here :)

https://en.cppreference.com/w/cpp/algorithm/transform_inclusive_scan.html

@xlauko
Copy link
Contributor Author

xlauko commented Sep 30, 2025

Merge activity

  • Sep 30, 8:24 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Sep 30, 8:25 PM UTC: @xlauko merged this pull request with Graphite.

@xlauko xlauko merged commit fe9fba8 into main Sep 30, 2025
12 of 14 checks passed
@xlauko xlauko deleted the users/xlauko/openacc-cir-inclusive-scan-fix branch September 30, 2025 20:25
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
This fixes macos build, where otherwise the compilation yields an error: `no viable conversion from 'bool' to 'typename iterator_traits<const QualType *>::value_type`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants