Skip to content

[cmake] Check std::vector layout - #24000

Open
jblomer wants to merge 2 commits into
root-project:masterfrom
jblomer:ntuple-new-vector
Open

jblomer wants to merge 2 commits into
root-project:masterfrom
jblomer:ntuple-new-vector

Conversation

@jblomer

@jblomer jblomer commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

The std::vector layout, currently, uses three pointers (begin, end, end
of capacity). This is used by the ROOT I/O to work with vectors of
anything by treating any vector as a vector. The approach breaks,
however, with the std::vector layout in the libc++ unstable ABI that
implements vector with one pointer and two integers.

See also https://discourse.llvm.org/t/adding-a-size-based-vector-to-libc-s-unstable-abi/86306

Tested on Linux with clang 23 and latest libc++ built from sources.

@jblomer jblomer self-assigned this Nov 5, 2026
@jblomer
jblomer requested a review from bellenot as a code owner November 5, 2026 13:00
@jblomer jblomer added the in:I/O label Nov 5, 2026
Comment thread cmake/modules/check_libcpp_vector.cpp Resolved
Comment thread cmake/modules/CheckCompiler.cmake Resolved
Found by compiling with clang/libc++ on Linux.
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Test Results

    19 files      19 suites   2d 21h 47m 59s ⏱️
 3 862 tests  3 862 ✅ 0 💤 0 ❌
65 093 runs  65 093 ✅ 0 💤 0 ❌

Results for commit 8cc458d.

♻️ This comment has been updated with latest results.

@pcanal pcanal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks.

The std::vector layout, currently, uses three pointers (begin, end, end
of capacity). This is used by the ROOT I/O to work with vectors of
anything by treating any vector as a vector<char>.  The approach breaks,
however, with the std::vector layout in the libc++ unstable ABI that
implements vector with one pointer and two integers.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants