[Webkit-unassigned] [Bug 189987] [Win] error C2139: 'WebKit::UpdateInfo': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_assignable'

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 8 20:39:18 PDT 2018


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

--- Comment #5 from Fujii Hironori <Hironori.Fujii at sony.com> ---
This is a spec of MSVC.

https://developercommunity.visualstudio.com/content/problem/343550/webkit-an-undefined-class-is-not-allowed-as-an-arg.html?childToView=351971#comment-351971

> Thank you for your feedback! We have determined that this issue
> is not a bug, but is a consequence of our implementation of the
> resolution for LWG defect 2729 and 2958 (
> https://wg21.link/lwg2729 https://wg21.link/lwg2958 ). LWG 2729
> specifies that tuple's copy assignment shall be defined as
> deleted unless is_copy_assignable_v holds for all of the tuple's
> element types.
> 
> The repro contains a class Update with a non-static data member
> of type std::tuple<const WebKit::UpdateInfo&> where
> WebKit::UpdateInfo is an incomplete type. When the compiler
> generates Update's copy assignment operator, it must determine if
> overload resolution to determine the assignment operator used to
> copy Update's member of type std::tuple<const
> WebKit::UpdateInfo&> "results in an ambiguity or a function that
> is deleted or inaccessible from the defaulted assignment
> operator" so as to determine if Update's implicitly-defaulted
> copy assignment operator should be defined as deleted per C++17
> [class.copy.assign]/7.4. Performing that overload resolution for
> std::tuple's copy assignment then necessarily must check the
> constraint added by LWG 2729 and determine if
> is_copy_assignable_v<const WebKit::UpdateInfo&> holds.
> 
> It's impossible to determine if a reference to an incomplete type
> would be assignable if the referenced type were complete: the
> fact that this isn't a precondition of the is_XXX_assignable
> traits is a defect in the Standard and the subject of LWG 3099 (
> https://wg21.link/lwg3099 ). MSVC chooses to diagnose this
> particular precondition violation, some other compilers like to
> choose an answer arbitrarily ( https://godbolt.org/z/ao-bUK ),
> but in any case the program has undefined behavior.

-- 
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/20181009/b49827d5/attachment.html>


More information about the webkit-unassigned mailing list