Bug 143303 - Value assignment operator of Optional should be stricter
Summary: Value assignment operator of Optional should be stricter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 05:21 PDT by Antti Koivisto
Modified: 2015-04-02 08:55 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.25 KB, patch)
2015-04-01 05:25 PDT, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.