[llvm-bugs] [Bug 26961] New: non-standard implementation issue

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 16 05:09:48 PDT 2016


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

            Bug ID: 26961
           Summary: non-standard implementation issue
           Product: libc++
           Version: 3.8
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ionelpopescu97 at yahoo.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

The C++11 standard defines pointer_safety as:
   enum class pointer_safety { relaxed, preferred, strict };

But, currently pointer_safety is implemented as a struct.

This causes that the following test to fail, because it is initialized by a
constructor that takes an int:

#include <memory>

int main()
{
    std::pointer_safety d ;
    d = std::get_pointer_safety();

    return 0;
}



test.cpp:5:25: error: no matching constructor for initialization of
'std::pointer_safety'
    std::pointer_safety d ;
                        ^
/usr/include/c++/v1/memory:5406:5: note: candidate constructor not viable:
requires single argument '__v', but no arguments were provided
    pointer_safety(__lx __v) : __v_(__v) {}
    ^
/usr/include/c++/v1/memory:5394:25: note: candidate constructor (the implicit
copy constructor) not viable: requires 1 argument, but 0 were provided
struct _LIBCPP_TYPE_VIS pointer_safety
                        ^
/usr/include/c++/v1/memory:5394:25: note: candidate constructor (the implicit
move constructor) not viable: requires 1 argument, but 0 were provided
1 error generated.

-- 
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/20160316/a70e64a5/attachment.html>


More information about the llvm-bugs mailing list