Title: [293608] trunk
- Revision
- 293608
- Author
- dp...@igalia.com
- Date
- 2022-04-29 00:50:27 -0700 (Fri, 29 Apr 2022)
Log Message
[GCC] std::remove_cvref is undefined in GCC8.4
https://bugs.webkit.org/show_bug.cgi?id=239881
Reviewed by Žan Doberšek.
r293505 changed the guard that added std::remove_cvref if not defined
by GCC, checking __cplusplus <= 201703L.
However in Ubuntu GCC8.4 this flag's value is 201709L. Thus, the
evaluation of this flag cannot reliably determine whether the compiler
has to define std::remove_cvref or not.
Instead of relying on a predefined compiler flag, what the patch does is
to attempt to compile a small snippet of code to check whether std::remove_cvref
is supported by the compiler. If successful, the flag 'HAVE_STD_REMOVE_CVREF' is defined.
.:
* Source/cmake/OptionsCommon.cmake: Set and expose HAVE_STD_REMOVE_CVREF if needed.
* Source/cmake/WebKitCompilerFlags.cmake: Check whether GCC supports std::remove_cvref.
Source/WTF:
* wtf/StdLibExtras.h: Define std::remove_cvref if not defined by GCC.
Modified Paths
Diff
Modified: trunk/ChangeLog (293607 => 293608)
--- trunk/ChangeLog 2022-04-29 07:14:29 UTC (rev 293607)
+++ trunk/ChangeLog 2022-04-29 07:50:27 UTC (rev 293608)
@@ -1,3 +1,24 @@
+2022-04-29 Diego Pino Garcia <dp...@igalia.com>
+
+ [GCC] std::remove_cvref is undefined in GCC8.4
+ https://bugs.webkit.org/show_bug.cgi?id=239881
+
+ Reviewed by Žan Doberšek.
+
+ r293505 changed the guard that added std::remove_cvref if not defined
+ by GCC, checking __cplusplus <= 201703L.
+
+ However in Ubuntu GCC8.4 this flag's value is 201709L. Thus, the
+ evaluation of this flag cannot reliably determine whether the compiler
+ has to define std::remove_cvref or not.
+
+ Instead of relying on a predefined compiler flag, what the patch does is
+ to attempt to compile a small snippet of code to check whether std::remove_cvref
+ is supported by the compiler. If successful, the flag 'HAVE_STD_REMOVE_CVREF' is defined.
+
+ * Source/cmake/OptionsCommon.cmake: Set and expose HAVE_STD_REMOVE_CVREF if needed.
+ * Source/cmake/WebKitCompilerFlags.cmake: Check whether GCC supports std::remove_cvref.
+
2022-04-27 Jonathan Bedard <jbed...@apple.com>
[git-webkit] Run style checker
Modified: trunk/Source/WTF/ChangeLog (293607 => 293608)
--- trunk/Source/WTF/ChangeLog 2022-04-29 07:14:29 UTC (rev 293607)
+++ trunk/Source/WTF/ChangeLog 2022-04-29 07:50:27 UTC (rev 293608)
@@ -1,3 +1,23 @@
+2022-04-29 Diego Pino Garcia <dp...@igalia.com>
+
+ [GCC] std::remove_cvref is undefined in GCC8.4
+ https://bugs.webkit.org/show_bug.cgi?id=239881
+
+ Reviewed by Žan Doberšek.
+
+ r293505 changed the guard that added std::remove_cvref if not defined
+ by GCC, checking __cplusplus <= 201703L.
+
+ However in Ubuntu GCC8.4 this flag's value is 201709L. Thus, the
+ evaluation of this flag cannot reliably determine whether the compiler
+ has to define std::remove_cvref or not.
+
+ Instead of relying on a predefined compiler flag, what the patch does is
+ to attempt to compile a small snippet of code to check whether std::remove_cvref
+ is supported by the compiler. If successful, the flag 'HAVE_STD_REMOVE_CVREF' is defined.
+
+ * wtf/StdLibExtras.h: Define std::remove_cvref if not defined by GCC.
+
2022-04-27 Yusuke Suzuki <ysuz...@apple.com>
[JSC] Make DFG::OSRExit data unlinked
Modified: trunk/Source/WTF/wtf/StdLibExtras.h (293607 => 293608)
--- trunk/Source/WTF/wtf/StdLibExtras.h 2022-04-29 07:14:29 UTC (rev 293607)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2022-04-29 07:50:27 UTC (rev 293608)
@@ -605,8 +605,8 @@
#define WTFMove(value) std::move<WTF::CheckMoveParameter>(value)
-// TODO: Needed for GCC<=9.3. Remove it after Ubuntu 20.04 end of support (May 2023).
-#if defined(__GLIBCXX__) && __cplusplus <= 201703L
+// FIXME: Needed for GCC<=9.3. Remove it after Ubuntu 20.04 end of support (May 2023).
+#if defined(__GLIBCXX__) && !defined(HAVE_STD_REMOVE_CVREF)
namespace std {
template <typename T>
struct remove_cvref {
Modified: trunk/Source/cmake/OptionsCommon.cmake (293607 => 293608)
--- trunk/Source/cmake/OptionsCommon.cmake 2022-04-29 07:14:29 UTC (rev 293607)
+++ trunk/Source/cmake/OptionsCommon.cmake 2022-04-29 07:50:27 UTC (rev 293608)
@@ -232,3 +232,7 @@
elseif (STD_EXPERIMENTAL_FILESYSTEM_IS_AVAILABLE)
SET_AND_EXPOSE_TO_BUILD(HAVE_STD_EXPERIMENTAL_FILESYSTEM TRUE)
endif ()
+
+if (STD_REMOVE_CVREF_IS_AVAILABLE)
+ SET_AND_EXPOSE_TO_BUILD(HAVE_STD_REMOVE_CVREF TRUE)
+endif ()
Modified: trunk/Source/cmake/WebKitCompilerFlags.cmake (293607 => 293608)
--- trunk/Source/cmake/WebKitCompilerFlags.cmake 2022-04-29 07:14:29 UTC (rev 293607)
+++ trunk/Source/cmake/WebKitCompilerFlags.cmake 2022-04-29 07:50:27 UTC (rev 293608)
@@ -417,3 +417,15 @@
# (see comment #28 in the link above).
WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-mno-lxc1-sxc1)
endif ()
+
+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ set(CMAKE_REQUIRED_FLAGS "--std=c++2a")
+ set(REMOVE_CVREF_TEST_SOURCE "
+ #include <type_traits>
+ int main() {
+ using type = std::remove_cvref_t<int&>;
+ }
+ ")
+ check_cxx_source_compiles("${REMOVE_CVREF_TEST_SOURCE}" STD_REMOVE_CVREF_IS_AVAILABLE)
+ unset(CMAKE_REQUIRED_FLAGS)
+endif ()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes