https://bugs.llvm.org/show_bug.cgi?id=39232

            Bug ID: 39232
           Summary: Regression: std::variant is not a literal type
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: ldio...@apple.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com,
                    richard-l...@metafoo.co.uk

The following program does not compile under Clang ToT:

================================================
#include <variant>

struct ValueBase {
protected:
    constexpr ValueBase() noexcept { }
    constexpr ValueBase(ValueBase const&) noexcept { }
    constexpr ValueBase(ValueBase&&) noexcept { }
};

struct NoCtors : ValueBase {
    NoCtors() = delete;
    NoCtors(NoCtors const&) = delete;
};

int main() {
    using V = std::variant<int, NoCtors>;
    constexpr V v;
}
================================================

Live reproduction: https://wandbox.org/permlink/b0trjzltSeq2Hirb

This reproducer was lifted from libc++'s test case
test/std/utilities/variant/variant.variant/variant.status/index.pass.cpp. It
started failing with Clang's r343131:

Author: Richard Smith <richard-l...@metafoo.co.uk>
Date:   Wed Sep 26 19:00:16 2018 +0000

    P1008R1 Classes with user-declared constructors are never aggregates in
    C++20.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to