WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
170662
[WTF] Annotate Seconds' member functions and operators with constexpr
https://bugs.webkit.org/show_bug.cgi?id=170662
Summary
[WTF] Annotate Seconds' member functions and operators with constexpr
Yusuke Suzuki
Reported
2017-04-09 17:41:49 PDT
[WTF] Annotate Seconds' member functions and operators with constexpr
Attachments
Patch
(9.36 KB, patch)
2017-04-09 17:44 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(8.93 KB, patch)
2017-04-09 17:49 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Patch
(8.93 KB, patch)
2017-04-09 18:01 PDT
,
Yusuke Suzuki
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2017-04-09 17:44:51 PDT
Created
attachment 306638
[details]
Patch
Yusuke Suzuki
Comment 2
2017-04-09 17:49:43 PDT
Created
attachment 306639
[details]
Patch
Yusuke Suzuki
Comment 3
2017-04-09 18:01:32 PDT
Created
attachment 306640
[details]
Patch
Daniel Bates
Comment 4
2017-04-09 19:12:45 PDT
Comment on
attachment 306640
[details]
Patch r=me
Yusuke Suzuki
Comment 5
2017-04-09 19:13:51 PDT
Comment on
attachment 306640
[details]
Patch Thanks!
Daniel Bates
Comment 6
2017-04-09 19:19:26 PDT
Comment on
attachment 306640
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306640&action=review
> Source/WTF/wtf/MathExtras.h:200 > + return (value >= static_cast<double>(max)) ? max : ((value <= static_cast<double>(min)) ? min : static_cast<T>(value));
I take to that we must support one or more compilers that do not support C++14 extended constexpr and hence had to rewrite this function to have a single return statement.
Yusuke Suzuki
Comment 7
2017-04-09 19:29:23 PDT
Comment on
attachment 306640
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=306640&action=review
>> Source/WTF/wtf/MathExtras.h:200 >> + return (value >= static_cast<double>(max)) ? max : ((value <= static_cast<double>(min)) ? min : static_cast<T>(value)); > > I take to that we must support one or more compilers that do not support C++14 extended constexpr and hence had to rewrite this function to have a single return statement.
Right. At least, WebKitGTK+ needs to support GCC 4.9 now, which does not support C++14 relaxed constexpr. Once C++14 relaxed constexpr is allowed, the above code will be much simplified.
WebKit Commit Bot
Comment 8
2017-04-09 19:41:07 PDT
Comment on
attachment 306640
[details]
Patch Clearing flags on attachment: 306640 Committed
r215169
: <
http://trac.webkit.org/changeset/215169
>
WebKit Commit Bot
Comment 9
2017-04-09 19:41:09 PDT
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 10
2017-04-09 20:34:24 PDT
Thanks for doing this. I’ll use it in my next patch.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug