[llvm-bugs] [Bug 35491] New: std::array of size 0 cannot be constructed if the type has no default constructor

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 1 03:53:19 PST 2017


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

            Bug ID: 35491
           Summary: std::array of size 0 cannot be constructed if the type
                    has no default constructor
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jeanmichael.celerier at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

The following code passes in libstdc++: 

    struct foo { foo(int) { } }; 
    std::array<foo, 0> arr{};

But with libc++, I get 

     error: no matching constructor for initialization of 'array<foo,
0>::value_type' (aka 'foo') 

which is weird since there shouldn't be any `foo` to initialize.

-- 
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/20171201/ec4b0393/attachment.html>


More information about the llvm-bugs mailing list