Sitelet https://github.com/RcppCore/RcppParallel/pull/280
Skip to content

include <algorithm> in tbb/concurrent_queue.h - #280

Merged
kevinushey merged 1 commit into
masterfrom
bugfix/clang23-missing-algorithm-include
Aug 26, 2026
Merged

include <algorithm> in tbb/concurrent_queue.h#280
kevinushey merged 1 commit into
masterfrom
bugfix/clang23-missing-algorithm-include

Conversation

@kevinushey

Copy link
Copy Markdown
Contributor

CRAN's clang-trunk (clang 23) checks fail to install RcppParallel:

https://www.stats.ox.ac.uk/pub/bdr/clang23/RcppParallel.log

include/oneapi/tbb/concurrent_queue.h:275:63: error: no member named 'equal' in namespace 'std'
include/oneapi/tbb/concurrent_queue.h:669:49: error: no member named 'equal' in namespace 'std'

concurrent_queue.h uses std::equal in the operator== of both
concurrent_queue and concurrent_bounded_queue, but never includes
<algorithm> -- it relied on some other header dragging it in. libc++ trunk no
longer does, so compiling src/tbb/concurrent_bounded_queue.cpp fails and takes
the whole bundled oneTBB build down with it.

Adds the include, and records it in patches/ so it survives the next
tools/tbb/update-tbb.R run.

Notes

  • Still unfixed upstream as of oneTBB master; the patch file says to drop this
    once it is.
  • Swept every header under src/tbb for <algorithm>/<numeric> functions
    used without the include (std::max/std::min included) --
    concurrent_queue.h was the only one. concurrent_vector.h,
    concurrent_lru_cache.h, blocked_rangeNd.h and parallel_sort.h already
    include it explicitly.
  • The remaining noise in that log (-Wunused-template,
    -Wunused-private-field) is from BDR's extra warning flags on upstream TBB
    code, not errors, and is left alone.

Verification

  • git apply --check --reverse passes for all seven files in patches/.
  • Syntax-checked the patched header at C++17 and C++20, plus the TU that
    actually failed on CRAN (src/tbb/src/tbb/concurrent_bounded_queue.cpp).

libc++ trunk no longer pulls <algorithm> in transitively, so the std::equal
used by concurrent_queue/concurrent_bounded_queue operator== fails to resolve
on CRAN's clang-trunk checks.
@kevinushey
kevinushey merged commit 8a49288 into master Aug 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant