Tear out trivial_abi on unique_ptr

Turns out people are bad at not combining code compiled with GCC
and Clang, and the improvement from `trivial_abi` on `unique_ptr`
is not worth the maintenance cost of having this be an opt-in
change.

Closes #2344
This commit is contained in:
Martin Hořeňovský 2022-01-05 00:04:21 +01:00
parent 103cb16696
commit fff494c10a
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
1 changed files with 2 additions and 12 deletions

View File

@ -13,25 +13,15 @@
#include <catch2/internal/catch_move_and_forward.hpp>
#if defined(__clang__) && defined(__has_attribute)
# if __has_attribute(trivial_abi)
# define TRIVIAL_ABI [[clang::trivial_abi]]
# endif
#endif
#if !defined(TRIVIAL_ABI)
# define TRIVIAL_ABI
#endif
namespace Catch {
namespace Detail {
/**
* A reimplementation of `std::unique_ptr` for improved compilation performance
*
* Does not support arrays nor custom deleters, but has trivial ABI
* when supposed by the compiler.
* Does not support arrays nor custom deleters.
*/
template <typename T>
class TRIVIAL_ABI unique_ptr {
class unique_ptr {
T* m_ptr;
public:
constexpr unique_ptr(std::nullptr_t = nullptr):