[libcxx-commits] [PATCH] D65161: [libc++] Implement LWG 2510

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 19 08:38:09 PDT 2019

ldionne marked 2 inline comments as done.
ldionne added inline comments.

Comment at: libcxx/include/type_traits:2819
+template <class _Tp>
+struct __is_implicitly_default_constructible<_Tp, decltype(__test_implicit_default_constructible<_Tp const&>({}))>
+    : is_default_constructible<_Tp>
zoecarver wrote:
> You probably need an `#if _LIBCPP_STD_VER > 03` here.
If you're thinking about the use of `decltype`, it's fine to assume that we have it in C++03 mode too. However, the implicit construction via `{}` is indeed a C++11 feature that's not supported in C++03, so I'll need to find another way to perform the check.

I think we want to find a way to do the check in C++03 instead of always having `__is_implicitly_default_constructible<T>::value == false` because that will change the explicit-ness of things like `std::pair` in C++03 vs C++11, which is a notable change. Also, the intent of a DR is to have it back-applied so it would be nice if we could implement the issue resolution even in C++03.

I'll admit I can't think of any way to implement the check in C++03 though.

Comment at: libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.fail.cpp:10
 // <memory>
+// struct allocator_arg_t { explicit allocator_arg_t() = default; };
zoecarver wrote:
> `// UNSUPPORTED: c++98, c++03`
I think we should do our best to support this test (and the similar ones below) in C++03, since this is a DR.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list