[Webkit-unassigned] [Bug 170875] New: Cannot compile JavaScriptCore/runtime/VMTraps.cpp on FreeBSD because std::pair has a non-trivial copy constructor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 15 08:26:25 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=170875

            Bug ID: 170875
           Summary: Cannot compile JavaScriptCore/runtime/VMTraps.cpp on
                    FreeBSD because std::pair has a non-trivial copy
                    constructor
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: lantw44 at gmail.com

In JavaScriptCore/runtime/VMTraps.cpp, function findActiveVMAndStackBounds returns a WTF::Expected<std::pair<JSC::VM*, WTF::StackBounds>, JSC::VMTraps::Error>. The parent class of this type is WTF::ExpectedDetail::ConstexprBase<std::pair<JSC::VM*, WTF::StackBounds>, JSC::VMTraps::Error>.

WTF::ExpectedDetail::ConstexprBase doesn't have a user-defined copy constructor, and its implicitly-defined copy constructor is deleted because the default std::pair implementation on FreeBSD has a non-trivial copy constructor. /usr/include/c++/v1/__config says _LIBCPP_TRIVIAL_PAIR_COPY_CTOR is disabled in order to keep ABI compatibility: https://svnweb.freebsd.org/changeset/base/261801.


Error messages showed by the compiler (clang 3.8):

/path/to/WebKit/Source/JavaScriptCore/runtime/VMTraps.cpp:96:9: error: returning object of type 'Expected<std::pair<VM *, StackBounds>, VMTraps::Error>' invokes deleted constructor
        return makeUnexpected(VMTraps::Error::LockUnavailable);
        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../Source/WTF/wtf/Expected.h:262:5: note: explicitly defaulted function was implicitly deleted here
    Expected(const Expected&) = default;
    ^
../../Source/WTF/wtf/Expected.h:248:18: note: copy constructor of 'Expected<std::__1::pair<JSC::VM *, WTF::StackBounds>, JSC::VMTraps::Error>' is implicitly deleted because base class 'ExpectedDetail::BaseSelect<pair<VM *, StackBounds>, Error>' (aka 'WTF::ExpectedDetail::ConstexprBase<std::__1::pair<JSC::VM *, WTF::StackBounds>, JSC::VMTraps::Error>') has a deleted copy constructor
class Expected : private ExpectedDetail::BaseSelect<T, E> {
                 ^
../../Source/WTF/wtf/Expected.h:145:44: note: copy constructor of 'ConstexprBase<std::__1::pair<JSC::VM *, WTF::StackBounds>, JSC::VMTraps::Error>' is implicitly deleted because field 's' has a deleted copy constructor
    ConstexprStorage<ValueType, ErrorType> s;
                                           ^
../../Source/WTF/wtf/Expected.h:87:15: note: copy constructor of 'ConstexprStorage<std::__1::pair<JSC::VM *, WTF::StackBounds>, JSC::VMTraps::Error>' is implicitly deleted because variant field 'val' has a non-trivial copy constructor
    ValueType val;
              ^

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170415/a419e5e0/attachment-0001.html>


More information about the webkit-unassigned mailing list