| Summary: | [MSVC] wtf/Optional.h: error C2280: 'WTF::constexpr_storage_t<T> &WTF::constexpr_storage_t<T>::operator =(const WTF::constexpr_storage_t<T> &)': attempting to reference a deleted function | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | QuellaZhang <1998zhangyi> | ||||||||
| Component: | New Bugs | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, ews-watchlist, Hironori.Fujii, keith_miller, webkit-bug-importer, ysuzuki | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 10 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
QuellaZhang
2020-07-30 19:34:52 PDT
I don't see any compilation errors for WinCairo trunk@265079.
> perl Tools\Scripts\build-webkit --wincairo --release
I'm using:
Visual Studio 2019 version 16.6.5
Windows 10 SDK (10.0.19041.0)
Windows 10 ver.1903 64bit
What's the difference?
This is my cl.exe version Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64 This seems a MSVC issue. Please report it to Microsoft. Hi Fujii, Thanks for your info. We use open source projects to test the unreleased version of vs. We will report it to VC++ Team. Thanks, Lin 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
Created attachment 405904 [details]
UnifiedSource-f2e18ffc-32.cpp Precompiled file
std::is_trivially_copyable_v was added by r262252. Bug 212383 – for-of should check the iterable is a JSArray for FastArray in DFG iterator_open Created attachment 405940 [details]
Patch
Comment on attachment 405940 [details]
Patch
r=me
Thank you for the review. jsc testing EWS failed wasm.yaml/wasm/lowExecutableMemory/imports-oom.js.default-wasm. However, the test case seems flaky on EWS. Other patch also failed it flakily. https://ews-build.webkit.org/#/builders/1/builds/19563 Comment on attachment 405940 [details] Patch Clearing flags on attachment: 405940 Committed r265265: <https://trac.webkit.org/changeset/265265> All reviewed patches have been landed. Closing bug. |