Z3Prover / z3

The Z3 Theorem Prover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++23 compatibility

NikolajBjorner opened this issue · comments

std::aligned_storage is deprecated in newer versions of C++.

typename std::aligned_storage<sizeof(T), alignof(T)>::type m_initial_buffer[INITIAL_SIZE];

https://github.com/Z3Prover/z3/blob/84092cbd96a1d4c65bea6db2370807b19519704e/src/util/buffer.h#L33C5-L33C95

What is the correct change (to alignas(T)...)?

This is addressed in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1413r3.pdf which suggests using alignas(T) std::byte buf[...], but with some caveats and discussion.