[llvm-bugs] [Bug 26654] New: std::unique_ptr<[]> does not work with vector types

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 17 11:19:09 PST 2016


            Bug ID: 26654
           Summary: std::unique_ptr<[]> does not work with vector types
           Product: libc++
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

$ cat 1.cc
#include <memory>

typedef float T __attribute__((__vector_size__(16)));

void f(T t) {
  std::unique_ptr<T[]> ptr(new T[5]);
  ptr[0] = t;

$ clang++ 1.cc -c -std=c++11 -stdlib=libc++
1.cc:13:10: error: expression is not assignable
  ptr[0] = get();
  ~~~~~~ ^
1 error generated.

It looks like __is_referenceable<T> is false and unique_ptr<T>::operator[]()
gets T as the return type instead of T&.

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/20160217/79a01f97/attachment.html>

More information about the llvm-bugs mailing list