[Webkit-unassigned] [Bug 215003] WebKit failed to build due to error C2280 on windows with MSVC

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 3 23:01:15 PDT 2020


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

QuellaZhang <1998zhangyi at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #5 from QuellaZhang <1998zhangyi at gmail.com> ---
Hi Fujii,

VC++ Team feedback detailed as below: 

Nope: this is not a compiler issue. The problem is this code:

  constexpr Optional(const Optional& rhs)
  : OptionalBase<T>()
  {
    if (rhs.initialized()) {
        if constexpr (std::is_trivially_copyable_v<T>)
            OptionalBase<T>::storage_ = *rhs;
        else
            ::new (static_cast<void*>(dataptr())) T(*rhs);
        OptionalBase<T>::init_ = true;
    }
  }

In C++ the definition of std::is_trivially_copyable is currently:

"A trivially copyable class is a class:

   - that has at least one eligible copy constructor, move constructor, copy assignment operator, or move

     assignment operator (11.4.3, 11.4.4.2, 11.4.5),

   - where each eligible copy constructor, move constructor, copy assignment operator, and move assignment

     operator is trivial, and

   - that has a trivial, non-deleted destructor(11.4.6)."

And std::pair<JSC::SamplingProfiler::StackFrame::CodeLocation,JSC::CodeBlock *> meets the conditions of this definition. Note: just because a class meets the conditions of std::is_trivially_copyable doesn't mean it is trivially copyable in all circumstances it just means there exists at least one condition under which it would be trivially copyable. Note: if I change the definition of the function above to use 'std::is_trivially_copy_assignable_v' instead of 'std::is_trivially_copyable_v' then the code compiles. I also had to change the move-constructor just below.


We used unreleased version of vs as below:
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29129.96 for x64 

I've attached the UnifiedSource-f2e18ffc-32.i file. 

cl.exe /c /std:c++17 /TP UnifiedSource-f2e18ffc-32.i can reproduced this issue. If we tried to use 'std::is_trivially_copy_assignable_v' instead of 'std::is_trivially_copyable_v' in this UnifiedSource-f2e18ffc-32.i file. We can compile pass. Could you please take a look at this issue again? Thanks in advance!

Thanks,
Lin

-- 
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/20200804/6a58ecc5/attachment-0001.htm>


More information about the webkit-unassigned mailing list