On Mon, Sep 19, 2016 at 1:06 PM, Tim Shen <tims...@google.com> wrote: > I believe that it's a "typo" from me - it should be > is_trivially_destructible, not is_default_constructible (so that we > can avoid using aligned_storage in the corresponding specialization). > is_literal_type works, since literal types are trivially destructible.
Sorry I misunderstood your patch. The underlying problem is that _Variant_storage wasn't always default constructible, but it should be. Jon, your fix doesn't fix the following constexpr variation of your test case: struct X { constexpr X() { } }; constexpr std::variant<X> v1 = X{}; So I have a patch here to make _Variant_storage's internal union default constructible. Tested on x86_64-linux-gnu. -- Regards, Tim Shen
a.diff
Description: Binary data