Clang -std=c++17 compiles the following if using libstdc++: #include <tuple> static_assert(std::is_trivially_constructible_v<std::tuple<>>); But adding -stdlib=libc++ causes test.cc:3:1: error: static_assert failed due to requirement 'std::is_trivially_constructible_v<std::__1::tuple<>>
A few minutes of looking through the standard did not turn up any requirement that tuple<> be trivially constructible. trivially *destructible*, yes. > 4 If is_trivially_destructible_v<Ti> is true for all Ti, then the destructor of tuple is trivial. constexpr, yes. > The defaulted move and copy constructor of tuple<> shall be constexpr functions. Can you tell me where you believe this requirement comes from?
I have no idea if the standard requires this, but it would be a nice to have extension if it doesn't. Specially considering that libstdc++ has it.
(In reply to Rafael Ávila de Espíndola from comment #2) > I have no idea if the standard requires this, but it would be a nice to have > extension if it doesn't. Specially considering that libstdc++ has it. Generally speaking, I'm philosophically opposed to "things that everyone does, but aren't in the standard". If this is a good thing, then we should write it into the standard.
I think it's a reasonable thing to do as a matter of QOI. The change is very simple, too, and it's the natural way to write that default constructor IMO. Review here: https://reviews.llvm.org/D62618
Fixed in r363075.