[LLVMbugs] [Bug 17814] New: slice_array::operator= cannot use braced-init-list for its argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 5 06:00:31 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17814

            Bug ID: 17814
           Summary: slice_array::operator= cannot use braced-init-list for
                    its argument
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: hhinnant at apple.com
          Reporter: kariya_mitsuru at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code cannot be compiled with clang and libc++ r193963:

#include <valarray>

int main()
{
    std::valarray<char> a(10);
    a[std::slice(0, 2, 3)] = {'x', 'y'};
}


According to C++ standards(ISO/IEC 14882-2011),

1) a[std::slice(0, 2, 3)] returns slice_array<char>
2) slice_array<char> has a member function operator=(const valarray<char>&)
3) valarray<char> has a constructor valarray(initializer_list<char>)

Therefore, this code should be compiled successfully.

-- 
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/20131105/456b63bb/attachment.html>


More information about the llvm-bugs mailing list