Bug 143303

Summary: Value assignment operator of Optional should be stricter
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, cmarcelo, commit-queue, mmaxfield
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch kling: review+

Description Antti Koivisto 2015-04-01 05:21:56 PDT
struct Foo { mutable Optional<std::chrono::seconds> s; };
Foo foo, foo2;
foo = foo2;

doesn't build because it tries to use wrong operator=.
Comment 1 Antti Koivisto 2015-04-01 05:25:13 PDT
Created attachment 249914 [details]
patch
Comment 2 Andreas Kling 2015-04-01 13:54:38 PDT
Comment on attachment 249914 [details]
patch

OK
Comment 3 Antti Koivisto 2015-04-01 14:02:53 PDT
https://trac.webkit.org/r182254
Comment 4 Myles C. Maxfield 2015-04-01 15:41:32 PDT
Where's your test!?!?!?!
Comment 5 Antti Koivisto 2015-04-02 08:55:13 PDT
I don't think something like this requires a test. There are no functional changes. Code like http://trac.webkit.org/changeset/182271 just doesn't compile without this.

Note that Optional is simply our version of std::optional which is likely to be in C++17.