Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
WDYT about/would it be possible to add a test that would fail if we had an ABI break, but doesn't because we don't break ABI with this change (so long as we're not using the unstable ABI)?
| libcxx/include/__config | ||
|---|---|---|
| 97 | Are there some docs we can stick this in? Maybe mention it's enabled by default for the unstable ABI (as it should be). | |
| libcxx/include/iterator | ||
|---|---|---|
| 792 | There is no ABI implication here AFAICT, since the first member will always begin at offset 0 anyway. So this means this can just be #if _LIBCPP_STD_VER <= 14. Also, notice that your _LIBCPP_STD_VER is wrong, it should be compared to 14, not 11. The std::iterator bases were removed in C++17. | |
| 915 | Same. | |
| 983 | Same. | |
| 1027 | Same. | |
| 1104 | Same. | |
| libcxx/include/iterator | ||
|---|---|---|
| 792 | The ABI implication is the existence of the empty base (see https://quuxplusone.github.io/blog/2021/05/07/std-iterator-as-a-base-class/ ). For example, #include <vector>
#include <iterator>
#include <stdio.h>
struct S : std::back_insert_iterator<std::vector<int>>, std::iterator<std::output_iterator_tag, void, void, void, void> {};
int main() { printf("%d\n", (int)sizeof(S)); }returns 16 when compiled with clang++ -std=c++17 -D_LIBCPP_ABI_VERSION=1 (or before this patch), but 8 when compiled (after this patch) with clang++ -std=c++17 -D_LIBCPP_ABI_VERSION=2.
Darn, you're right. I had written in my post that LWG2438 was "a very late-breaking change to C++14," but I guess it was so late that it was C++17. ;) @tcanens' HTML version of N4140 (C++14) agrees that the base classes are still there in C++14. Will change. | |
| libcxx/include/iterator | ||
|---|---|---|
| 792 | Yeah, indeed, I just realized that you were right. This is pretty terrible. | |
Are there some docs we can stick this in? Maybe mention it's enabled by default for the unstable ABI (as it should be).