WebKit Bugzilla
Attachment 372614 Details for
Bug 199099
: Try to use C++14 std::enable_if_t in CheckedArithmetic.h again
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199099-20190621131004.patch (text/plain), 3.58 KB, created by
Fujii Hironori
on 2019-06-20 21:10:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Fujii Hironori
Created:
2019-06-20 21:10:06 PDT
Size:
3.58 KB
patch
obsolete
>Subversion Revision: 246667 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f87357dbf8d10f92880c6301fc026dfb2a653351..1baf27dc886c1b6c2744c83a229088ab10736b3a 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-20 Fujii Hironori <Hironori.Fujii@sony.com> >+ >+ Try to use C++14 std::enable_if_t in CheckedArithmetic.h again >+ https://bugs.webkit.org/show_bug.cgi?id=199099 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ r242235 changed CheckedArithmetic to not use C++14. Let's try >+ C++14 again. >+ >+ * wtf/CheckedArithmetic.h: Use C++14 std::make_unsigned_t and std::enable_if_t. >+ > 2019-06-18 Darin Adler <darin@apple.com> > > Tidy up the remaining bits of the AtomicString to AtomString rename >diff --git a/Source/WTF/wtf/CheckedArithmetic.h b/Source/WTF/wtf/CheckedArithmetic.h >index f09fea878d46464ccb578490a50ed0d676aeb607..c95540cd2d9c02a6018b11213de7dcef390d844f 100644 >--- a/Source/WTF/wtf/CheckedArithmetic.h >+++ b/Source/WTF/wtf/CheckedArithmetic.h >@@ -181,7 +181,7 @@ template <typename Target, typename Source> struct BoundsChecker<Target, Source, > { > // When converting value to unsigned Source, value will become a big value if value is negative. > // Casted value will become bigger than Target::max as Source is bigger than Target. >- return static_cast<typename std::make_unsigned<Source>::type>(value) <= std::numeric_limits<Target>::max(); >+ return static_cast<std::make_unsigned_t<Source>>(value) <= std::numeric_limits<Target>::max(); > } > }; > >@@ -541,7 +541,7 @@ template <typename ResultType> struct ArithmeticOperations<unsigned, int, Result > } > }; > >-template <class OverflowHandler, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type> >+template <class OverflowHandler, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> > inline constexpr bool observesOverflow() { return true; } > > template <> >@@ -553,7 +553,7 @@ template <typename U, typename V, typename R> static inline bool safeAdd(U lhs, > return true; > } > >-template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type> >+template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> > static inline bool safeAdd(U lhs, V rhs, R& result) > { > if (observesOverflow<OverflowHandler>()) >@@ -567,7 +567,7 @@ template <typename U, typename V, typename R> static inline bool safeSub(U lhs, > return ArithmeticOperations<U, V, R>::sub(lhs, rhs, result); > } > >-template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type> >+template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> > static inline bool safeSub(U lhs, V rhs, R& result) > { > if (observesOverflow<OverflowHandler>()) >@@ -581,7 +581,7 @@ template <typename U, typename V, typename R> static inline bool safeMultiply(U > return ArithmeticOperations<U, V, R>::multiply(lhs, rhs, result); > } > >-template <class OverflowHandler, typename U, typename V, typename R, typename = typename std::enable_if<!std::is_scalar<OverflowHandler>::value>::type> >+template <class OverflowHandler, typename U, typename V, typename R, typename = std::enable_if_t<!std::is_scalar<OverflowHandler>::value>> > static inline bool safeMultiply(U lhs, V rhs, R& result) > { > if (observesOverflow<OverflowHandler>())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ross.kirsling
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199099
: 372614