clang has = default as an extension in c++03, so just use it.
Details
- Reviewers
ldionne • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG4955095fe69f: [libc++] Remove _LIBCPP_DEFAULT
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxx/include/__config | ||
---|---|---|
840–844 | I have looked at this in the past and decided not to mess with it, because it changes our ABI in C++03 mode. @ldionne, could you take another look with ABI in mind and just confirm whether this still LGTY? Remember =defaulted members can be trivial, but {}'ed members are never trivial, for purposes of ABI. |
libcxx/include/__config | ||
---|---|---|
840–844 | Isn't _LIBCPP_HIDE_FROM_ABI supposed to mitiagte that problem? |
libcxx/include/__config | ||
---|---|---|
840–844 | No, in that we're talking about a property of the type (whether it's trivially foo-constructible), not a property of the member function per se. However, I'm retracting my concern, because I just looked for myself: _LIBCPP_DEFAULT is currently used in only the places touched in this PR, and:
I now say: Ship it! :) |
libcxx/include/__config | ||
---|---|---|
840–844 | Excellent observation though @Quuxplusone , I hadn't thought about that. I went really fast on the same streak as removing all the other C++03-or-older-compiler workarounds and missed this important fact. As you say, we're lucky and it's not actually an ABI break, but thanks for paying attention. This sort of ABI break (changing the triviality of widely used types) is the sort of thing that would break in the worst possible ways -- we'd certainly hear about it. |
I have looked at this in the past and decided not to mess with it, because it changes our ABI in C++03 mode. @ldionne, could you take another look with ABI in mind and just confirm whether this still LGTY?
Remember =defaulted members can be trivial, but {}'ed members are never trivial, for purposes of ABI.