Title: [225728] trunk/Source/WTF
Revision
225728
Author
[email protected]
Date
2017-12-09 13:42:02 -0800 (Sat, 09 Dec 2017)

Log Message

[WTF] Remove RELAXED_CONSTEXPR
https://bugs.webkit.org/show_bug.cgi?id=180624

Reviewed by JF Bastien.

All of our required compilers support relaxed constexpr in C++14.
We can drop RELAXED_CONSTEXPR macro in our tree.

* wtf/Compiler.h:
* wtf/Expected.h:
(std::experimental::fundamentals_v3::expected::operator*):
(std::experimental::fundamentals_v3::expected::value):
(std::experimental::fundamentals_v3::expected::error):
* wtf/Unexpected.h:
(std::experimental::fundamentals_v3::unexpected::value):
(std::experimental::fundamentals_v3::unexpected::value const):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (225727 => 225728)


--- trunk/Source/WTF/ChangeLog	2017-12-09 20:34:45 UTC (rev 225727)
+++ trunk/Source/WTF/ChangeLog	2017-12-09 21:42:02 UTC (rev 225728)
@@ -1,5 +1,24 @@
 2017-12-09  Yusuke Suzuki  <[email protected]>
 
+        [WTF] Remove RELAXED_CONSTEXPR
+        https://bugs.webkit.org/show_bug.cgi?id=180624
+
+        Reviewed by JF Bastien.
+
+        All of our required compilers support relaxed constexpr in C++14.
+        We can drop RELAXED_CONSTEXPR macro in our tree.
+
+        * wtf/Compiler.h:
+        * wtf/Expected.h:
+        (std::experimental::fundamentals_v3::expected::operator*):
+        (std::experimental::fundamentals_v3::expected::value):
+        (std::experimental::fundamentals_v3::expected::error):
+        * wtf/Unexpected.h:
+        (std::experimental::fundamentals_v3::unexpected::value):
+        (std::experimental::fundamentals_v3::unexpected::value const):
+
+2017-12-09  Yusuke Suzuki  <[email protected]>
+
         Fix WTF::Hasher tuple expansion with variadic args
         https://bugs.webkit.org/show_bug.cgi?id=180623
 

Modified: trunk/Source/WTF/wtf/Compiler.h (225727 => 225728)


--- trunk/Source/WTF/wtf/Compiler.h	2017-12-09 20:34:45 UTC (rev 225727)
+++ trunk/Source/WTF/wtf/Compiler.h	2017-12-09 21:42:02 UTC (rev 225728)
@@ -154,20 +154,6 @@
 #define WTF_COMPILER_SUPPORTS_NSDMI_FOR_AGGREGATES 1
 #endif
 
-/* RELAXED_CONSTEXPR */
-
-#if defined(__cpp_constexpr) && __cpp_constexpr >= 201304
-#define WTF_COMPILER_SUPPORTS_RELAXED_CONSTEXPR 1
-#endif
-
-#if !defined(RELAXED_CONSTEXPR)
-#if COMPILER_SUPPORTS(RELAXED_CONSTEXPR)
-#define RELAXED_CONSTEXPR constexpr
-#else
-#define RELAXED_CONSTEXPR
-#endif
-#endif
-
 #define ASAN_ENABLED COMPILER_HAS_CLANG_FEATURE(address_sanitizer)
 
 #if ASAN_ENABLED

Modified: trunk/Source/WTF/wtf/Expected.h (225727 => 225728)


--- trunk/Source/WTF/wtf/Expected.h	2017-12-09 20:34:45 UTC (rev 225727)
+++ trunk/Source/WTF/wtf/Expected.h	2017-12-09 21:42:02 UTC (rev 225728)
@@ -482,16 +482,16 @@
     constexpr const value_type& operator*() const & { return base::s.val; }
     value_type& operator*() & { return base::s.val; }
     constexpr const value_type&& operator*() const && { return std::move(base::s.val); }
-    RELAXED_CONSTEXPR value_type&& operator*() && { return std::move(base::s.val); }
+    constexpr value_type&& operator*() && { return std::move(base::s.val); }
     constexpr explicit operator bool() const { return base::has; }
     constexpr bool has_value() const { return base::has; }
     constexpr const value_type& value() const & { return base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val); }
-    RELAXED_CONSTEXPR value_type& value() & { return base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val); }
+    constexpr value_type& value() & { return base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val); }
     constexpr const value_type&& value() const && { return std::move(base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val)); }
-    RELAXED_CONSTEXPR value_type&& value() && { return std::move(base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val)); }
+    constexpr value_type&& value() && { return std::move(base::has ? base::s.val : (__EXPECTED_THROW(bad_expected_access<error_type>(base::s.err)), base::s.val)); }
     constexpr const error_type& error() const & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
     error_type& error() & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
-    RELAXED_CONSTEXPR error_type&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
+    constexpr error_type&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
     constexpr const error_type&& error() const && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
     template<class U> constexpr value_type value_or(U&& u) const & { return base::has ? **this : static_cast<value_type>(std::forward<U>(u)); }
     template<class U> value_type value_or(U&& u) && { return base::has ? std::move(**this) : static_cast<value_type>(std::forward<U>(u)); }
@@ -551,7 +551,7 @@
     void value() const { !base::has ? __EXPECTED_THROW(bad_expected_access<void>()) : void(); }
     constexpr const E& error() const & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
     E& error() & { return !base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err); }
-    RELAXED_CONSTEXPR E&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
+    constexpr E&& error() && { return std::move(!base::has ? base::s.err : (__EXPECTED_THROW(bad_expected_access<void>()), base::s.err)); }
 };
 
 template<class T, class E> constexpr bool operator==(const expected<T, E>& x, const expected<T, E>& y) { return bool(x) == bool(y) && (x ? x.value() == y.value() : x.error() == y.error()); }

Modified: trunk/Source/WTF/wtf/Unexpected.h (225727 => 225728)


--- trunk/Source/WTF/wtf/Unexpected.h	2017-12-09 20:34:45 UTC (rev 225727)
+++ trunk/Source/WTF/wtf/Unexpected.h	2017-12-09 21:42:02 UTC (rev 225728)
@@ -78,9 +78,9 @@
     constexpr explicit unexpected(const E& e) : val(e) { }
     constexpr explicit unexpected(E&& e) : val(std::forward<E>(e)) { }
     constexpr const E& value() const & { return val; }
-    RELAXED_CONSTEXPR E& value() & { return val; }
-    RELAXED_CONSTEXPR E&& value() && { return WTFMove(val); }
-    RELAXED_CONSTEXPR const E&& value() const && { return WTFMove(val); }
+    constexpr E& value() & { return val; }
+    constexpr E&& value() && { return WTFMove(val); }
+    constexpr const E&& value() const && { return WTFMove(val); }
 
 private:
     E val;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to