Skip to content

Fix includes for libc++ 23 - #46

Open
captaincrutches wants to merge 1 commit into
mpoeter:devfrom
captaincrutches:cc-includes
Open

captaincrutches wants to merge 1 commit into
mpoeter:devfrom
captaincrutches:cc-includes

Conversation

@captaincrutches

Copy link
Copy Markdown
Contributor

LLVM 23 made some breaking cleanups of transitive includes in libc++, which aligns system headers more closely with the spec but does in fact break a few xenium headers.

3 fixes for 3 files here. Reproducible with for file in $(ls xenium/*.hpp); do clang++ -c -I. -stdlib=libc++ $file; done

xenium/hash.hpp:47:37: error: no member named 'alignment_of' in namespace 'std'
   47 |     constexpr auto alignment = std::alignment_of<Key>();
      |                                     ^~~~~~~~~~~~

alignment_of is defined in type_traits, so added that.

xenium/policy.hpp:60:16: error: no type named 'size_t' in namespace 'std'
   60 | template <std::size_t Value>
      |           ~~~~~^

policy.hpp includes cstdint, but size_t is actually defined in cstddef (among others), so changed that.

xenium/aligned_object.hpp:34:25: error: no type named 'align_val_t' in namespace 'std'
   34 |   static constexpr std::align_val_t alignment() {
      |                    ~~~~~^

align_val_t is defined in new, so added that.

It all still compiles with all the compilers I happen to have installed: gcc-16, clang-22, and clang-23 (both libc++ and libstdc++).

@mpoeter
mpoeter changed the base branch from main to dev November 3, 2026 08:42
@captaincrutches

Copy link
Copy Markdown
Contributor Author

Rebased onto dev to fix the conflicts after the target change.

(The cmake changes there are most welcome, and work great when I point my consuming project at dev, so thanks for that too! 🎉)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant