[llvm-bugs] [Bug 39232] New: Regression: std::variant is not a literal type

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 9 11:04:47 PDT 2018


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: unassignedclangbugs at nondot.org
          Reporter: ldionne at apple.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com,
                    richard-llvm at 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-llvm at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181009/2c1b8737/attachment-0001.html>


More information about the llvm-bugs mailing list