Title: [293505] trunk/Source/WTF
Revision
293505
Author
dp...@igalia.com
Date
2022-04-27 04:59:59 -0700 (Wed, 27 Apr 2022)

Log Message

[GCC] GCC9.3 defines 'remove_cvref_t' but not '__cpp_lib_remove_cvref'
https://bugs.webkit.org/show_bug.cgi?id=239805

Reviewed by Žan Doberšek.

GCC9.3 defines 'remove_cvref_t' but not '__cpp_lib_remove_cvref'. The
latter was introduced in GCC9.4:

  https://github.com/gcc-mirror/gcc/blob/releases/gcc-9.4.0/libstdc%2B%2B-v3/include/std/type_traits#L3024

The flag '__cpp_lib_remove_cvref' is used to check whether 'remove_cvref_t'
is defined, but it's not posible to rely on it for GCC9.3 as explained on the
paragraph above.

Instead we check whether __cplusplus is <= 201703L since the GCC commit
that defined 'remove_cvref_t' does it if __cplusplus > 201703L. See:

  https://github.com/gcc-mirror/gcc/commit/6791489ee5214b0181aa22adc250cbbde1897a5c

* wtf/StdLibExtras.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (293504 => 293505)


--- trunk/Source/WTF/ChangeLog	2022-04-27 11:14:44 UTC (rev 293504)
+++ trunk/Source/WTF/ChangeLog	2022-04-27 11:59:59 UTC (rev 293505)
@@ -1,3 +1,26 @@
+2022-04-27  Diego Pino Garcia  <dp...@igalia.com>
+
+        [GCC] GCC9.3 defines 'remove_cvref_t' but not '__cpp_lib_remove_cvref'
+        https://bugs.webkit.org/show_bug.cgi?id=239805
+
+        Reviewed by Žan Doberšek.
+
+        GCC9.3 defines 'remove_cvref_t' but not '__cpp_lib_remove_cvref'. The
+        latter was introduced in GCC9.4:
+        
+          https://github.com/gcc-mirror/gcc/blob/releases/gcc-9.4.0/libstdc%2B%2B-v3/include/std/type_traits#L3024
+        
+        The flag '__cpp_lib_remove_cvref' is used to check whether 'remove_cvref_t'
+        is defined, but it's not posible to rely on it for GCC9.3 as explained on the
+        paragraph above.
+        
+        Instead we check whether __cplusplus is <= 201703L since the GCC commit
+        that defined 'remove_cvref_t' does it if __cplusplus > 201703L. See:
+        
+          https://github.com/gcc-mirror/gcc/commit/6791489ee5214b0181aa22adc250cbbde1897a5c
+
+        * wtf/StdLibExtras.h:
+
 2022-04-26  Manuel Rego Casasnovas  <r...@igalia.com>
 
         Remove AriaReflectionEnabled runtime flag

Modified: trunk/Source/WTF/wtf/StdLibExtras.h (293504 => 293505)


--- trunk/Source/WTF/wtf/StdLibExtras.h	2022-04-27 11:14:44 UTC (rev 293504)
+++ trunk/Source/WTF/wtf/StdLibExtras.h	2022-04-27 11:59:59 UTC (rev 293505)
@@ -605,7 +605,8 @@
 
 #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value)
 
-#if defined(__GLIBCXX__) && !defined(__cpp_lib_remove_cvref)
+// TODO: Needed for GCC<=9.3. Remove it after Ubuntu 20.04 end of support (May 2023).
+#if defined(__GLIBCXX__) && __cplusplus <= 201703L
 namespace std {
 template <typename T>
 struct remove_cvref {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to