-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::char_traits<std::byte> removed in libc++ 18 #726
Comments
Oh dear. This looks like a huge problem. And I'm on vacation right now, which severely limits my ability to look into it. |
Whipped up a quick patch to get things compiling based on libc++'s now-removed generic implementation, but it definitely isn't clean and fit for a PR. Should give you an idea of what will be required though. LLVM 17 is due to be out in the second half of September. That should still only serve deprecation warnings though. So no need to hurry terribly, just the people truly living at head are broken currently. 🙂 |
Thanks! Really appreciate the help while I'm without a computer. In the longer term, the problem is that I opted for strings and views of |
Hi @tambry — I'm back from my vacation. My laptop was also having a problem so I didn't take it with me. Really appreciate the patch. Of course it makes me a bit nervous: what if the compiler does choose to specialise And we don't have a lot of alternatives, do we? It would seem sensible to replace |
Please keep in mind that I threw the patch together very quickly just to get it compiling!
You can just always pass in your custom So to keep compatibility with existing code you'd probably want an alias to
Agreed.
Nothing other than a custom wrapper, but that would be both an API and ABI breaking change. |
This removal was reverted in llvm/llvm-project@cce062d and deferred to LLVM 19. So there's some more time to handle this before user complaints roll in. |
That's good news @tambry. I think I'll just go with your proposed patch. |
Come to think of it... Care to make it a PR? Easier to review, and also means you automatically get credit in the logs etc. :-) |
I'll have a go at a MR. Might take a few weeks as I'm quite busy of late. 🙂 |
Perhaps for now I should start promoting the use of |
Finally got around to this. PR #751. |
There has been no activity on this ticket. Consider closing it. |
Still very much hoping to get this on board for a 7.9 release! |
…yte> (#751) The standard doesn't specify a generic implementation of std::char_traits, only specializations for certain types. For a good reason: it's unlikely to be correct for all types that it'll compile with it. All standard libraries today however do provide a generic implementation as an extension, though it's bound to be incorrect for some types. libc++ has deprecated its in version 18 and will remove it in version 19 to eliminate hard to find correctness issues stemming from this. Replace with type aliases that will use a custom char_traits when the standard library lacks such a generic implementation. Note that we don't unconditionally use the custom char_traits variant as it's a source-breaking change requiring the users to update all usages of `std::string<std::byte>` to `pqxx::bytes` (i.e. `std::string<std::byte, pqxx::byte_char_traits>`). Ditto `std::string_view<std::byte>` and `pqxx::bytes_view`. But for implementations lacking a generic implementation `std::string<std::byte>` and `std::string_view<std::byte>` wouldn't compile anyway so it's fine. The aliases are named as `bytes` and `bytes_view` with the intetion of switching them to `std::vector<std::byte>` and `std::span<std::byte>` in a future major release that requires C++20. Fixes: #726 By Raul Tambre <[email protected]>
libc++ version 18 breaks compiling libpqxx:
Relevant changelog entry from LLVM 17:
The text was updated successfully, but these errors were encountered: