[libcxx-commits] [PATCH] D102119: [libcxx][optional] adds missing constexpr operations

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 16 21:52:58 PDT 2021

tcanens added inline comments.

Comment at: libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp:43
         static_assert(std::is_trivially_destructible<optional<T>>::value, "");
-        static_assert(std::is_literal_type<optional<T>>::value, "");
cjdb wrote:
> zoecarver wrote:
> > We should still test this pre-c++20, I think. You could group them all together at the end, though.
> 🤷 `std::is_literal_type` was deprecated in C++17 with the rationale
> > The traits had unreliable or awkward interfaces. The `is_literal_type` trait provided no way to detect which subset of constructors and member functions of a type were declared constexpr.
> I'm not sure our tests should have something unreliable?
The problem with `is_literal_type` is that it provides an answer to a mostly useless question - knowing that a type has //some// constexpr constructor tells you pretty much nothing about what you can do with it. The trait itself is perfectly reliable.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list