Title: [231753] trunk
Revision
231753
Author
zandober...@gmail.com
Date
2018-05-14 05:52:25 -0700 (Mon, 14 May 2018)

Log Message

[GTK] REGRESSION(r231170) Build broken with Clang 5.0
https://bugs.webkit.org/show_bug.cgi?id=185198

Reviewed by Michael Catanzaro.

.:

* Source/cmake/WebKitCompilerFlags.cmake: Fall back to the -std=c++1z
compiler flag if -std=c++17 is not supported. If that flag is not
supported either, bail with an error message.

Source/WebCore:

Avoid gperf files using the register keyword which has been made
reserved and as such unusable in C++17.

* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* css/makeprop.pl:
* css/makevalues.pl:
* platform/ColorData.gperf:
* platform/ReferrerPolicy.h: With std::optional forward declaration
gone, explicitly include the WTF Optional.h header.
* platform/Theme.h: Ditto.
* platform/network/create-http-header-name-table:

Source/WebKit:

* Shared/RTCNetwork.h: With std::optional forward declaration gone,
explicitly include the WTF Optional.h header.

Source/WTF:

* wtf/Compiler.h:
* wtf/Forward.h: Delete the std::optional forward declaration that is
potentially incompatible with definition provided by the standard library.
* wtf/Hasher.h:
* wtf/StdLibExtras.h: In addition to the remaining C++14 configurations,
also use custom std::in_place_t implementation when compiling with
libstdc++ 6.x, which doesn't provide its own.

Modified Paths

Diff

Modified: trunk/ChangeLog (231752 => 231753)


--- trunk/ChangeLog	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/ChangeLog	2018-05-14 12:52:25 UTC (rev 231753)
@@ -1,3 +1,14 @@
+2018-05-14  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK] REGRESSION(r231170) Build broken with Clang 5.0
+        https://bugs.webkit.org/show_bug.cgi?id=185198
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/WebKitCompilerFlags.cmake: Fall back to the -std=c++1z
+        compiler flag if -std=c++17 is not supported. If that flag is not
+        supported either, bail with an error message.
+
 2018-05-09  Jan Alexander Steffens  <jan.steff...@gmail.com>
 
         [GTK] gtk-doc installation subdir duplicated

Modified: trunk/Source/WTF/ChangeLog (231752 => 231753)


--- trunk/Source/WTF/ChangeLog	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WTF/ChangeLog	2018-05-14 12:52:25 UTC (rev 231753)
@@ -1,3 +1,18 @@
+2018-05-14  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK] REGRESSION(r231170) Build broken with Clang 5.0
+        https://bugs.webkit.org/show_bug.cgi?id=185198
+
+        Reviewed by Michael Catanzaro.
+
+        * wtf/Compiler.h:
+        * wtf/Forward.h: Delete the std::optional forward declaration that is
+        potentially incompatible with definition provided by the standard library.
+        * wtf/Hasher.h:
+        * wtf/StdLibExtras.h: In addition to the remaining C++14 configurations,
+        also use custom std::in_place_t implementation when compiling with
+        libstdc++ 6.x, which doesn't provide its own.
+
 2018-05-13  Filip Pizlo  <fpi...@apple.com>
 
         Disable pointer poisoning

Modified: trunk/Source/WTF/wtf/Compiler.h (231752 => 231753)


--- trunk/Source/WTF/wtf/Compiler.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WTF/wtf/Compiler.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -74,6 +74,8 @@
 #define WTF_CPP_STD_VER 11
 #elif __cplusplus <= 201402L
 #define WTF_CPP_STD_VER 14
+#elif __cplusplus <= 201703L
+#define WTF_CPP_STD_VER 17
 #endif
 #endif
 

Modified: trunk/Source/WTF/wtf/Forward.h (231752 => 231753)


--- trunk/Source/WTF/wtf/Forward.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WTF/wtf/Forward.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -22,10 +22,6 @@
 
 #include <stddef.h>
 
-namespace std {
-template<typename T> class optional;
-}
-
 namespace WTF {
 
 class AtomicString;

Modified: trunk/Source/WTF/wtf/Hasher.h (231752 => 231753)


--- trunk/Source/WTF/wtf/Hasher.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WTF/wtf/Hasher.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -21,6 +21,7 @@
 #pragma once
 
 #include <wtf/Forward.h>
+#include <wtf/Optional.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/StringHasher.h>
 

Modified: trunk/Source/WTF/wtf/StdLibExtras.h (231752 => 231753)


--- trunk/Source/WTF/wtf/StdLibExtras.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WTF/wtf/StdLibExtras.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -543,7 +543,9 @@
 template<class... _Args> struct conjunction : wtf_conjunction_impl<_Args...> { };
 #endif
 
-#if __cplusplus < 201703L
+// Provide in_place_t when not building with -std=c++17, or when building with libstdc++ 6
+// (which doesn't define the _GLIBCXX_RELEASE macro that's been introduced in libstdc++ 7).
+#if __cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE))
 
 // These are inline variable for C++17 and later.
 #define __IN_PLACE_INLINE_VARIABLE static const

Modified: trunk/Source/WebCore/ChangeLog (231752 => 231753)


--- trunk/Source/WebCore/ChangeLog	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/ChangeLog	2018-05-14 12:52:25 UTC (rev 231753)
@@ -1,3 +1,23 @@
+2018-05-14  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK] REGRESSION(r231170) Build broken with Clang 5.0
+        https://bugs.webkit.org/show_bug.cgi?id=185198
+
+        Reviewed by Michael Catanzaro.
+
+        Avoid gperf files using the register keyword which has been made
+        reserved and as such unusable in C++17.
+
+        * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
+        * css/makeSelectorPseudoElementsMap.py:
+        * css/makeprop.pl:
+        * css/makevalues.pl:
+        * platform/ColorData.gperf:
+        * platform/ReferrerPolicy.h: With std::optional forward declaration
+        gone, explicitly include the WTF Optional.h header.
+        * platform/Theme.h: Ditto.
+        * platform/network/create-http-header-name-table:
+
 2018-05-14  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r219515.

Modified: trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py (231752 => 231753)


--- trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2018-05-14 12:52:25 UTC (rev 231753)
@@ -97,10 +97,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wdeprecated-register"
 #pragma clang diagnostic ignored "-Wimplicit-fallthrough"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 
 struct SelectorPseudoClassOrCompatibilityPseudoElementEntry {

Modified: trunk/Source/WebCore/css/makeSelectorPseudoElementsMap.py (231752 => 231753)


--- trunk/Source/WebCore/css/makeSelectorPseudoElementsMap.py	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/css/makeSelectorPseudoElementsMap.py	2018-05-14 12:52:25 UTC (rev 231753)
@@ -95,10 +95,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wdeprecated-register"
 #pragma clang diagnostic ignored "-Wimplicit-fallthrough"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 
 struct SelectorPseudoTypeEntry {

Modified: trunk/Source/WebCore/css/makeprop.pl (231752 => 231753)


--- trunk/Source/WebCore/css/makeprop.pl	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/css/makeprop.pl	2018-05-14 12:52:25 UTC (rev 231753)
@@ -252,10 +252,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored \"-Wunknown-pragmas\"
-#pragma clang diagnostic ignored \"-Wdeprecated-register\"
 #pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 
 // Using std::numeric_limits<uint16_t>::max() here would be cleaner,

Modified: trunk/Source/WebCore/css/makevalues.pl (231752 => 231753)


--- trunk/Source/WebCore/css/makevalues.pl	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/css/makevalues.pl	2018-05-14 12:52:25 UTC (rev 231753)
@@ -76,10 +76,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored \"-Wunknown-pragmas\"
-#pragma clang diagnostic ignored \"-Wdeprecated-register\"
 #pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 %}
 %struct-type

Modified: trunk/Source/WebCore/platform/ColorData.gperf (231752 => 231753)


--- trunk/Source/WebCore/platform/ColorData.gperf	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/platform/ColorData.gperf	2018-05-14 12:52:25 UTC (rev 231753)
@@ -5,10 +5,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wdeprecated-register"
 #pragma clang diagnostic ignored "-Wimplicit-fallthrough"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 %}
 %struct-type

Modified: trunk/Source/WebCore/platform/ReferrerPolicy.h (231752 => 231753)


--- trunk/Source/WebCore/platform/ReferrerPolicy.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/platform/ReferrerPolicy.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -34,6 +34,7 @@
 
 #include <wtf/EnumTraits.h>
 #include <wtf/Forward.h>
+#include <wtf/Optional.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/Theme.h (231752 => 231753)


--- trunk/Source/WebCore/platform/Theme.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/platform/Theme.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -27,6 +27,7 @@
 
 #include "ThemeTypes.h"
 #include <wtf/Forward.h>
+#include <wtf/Optional.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/network/create-http-header-name-table (231752 => 231753)


--- trunk/Source/WebCore/platform/network/create-http-header-name-table	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebCore/platform/network/create-http-header-name-table	2018-05-14 12:52:25 UTC (rev 231753)
@@ -93,10 +93,12 @@
 #if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wdeprecated-register"
 #pragma clang diagnostic ignored "-Wimplicit-fallthrough"
 #endif
 
+// Older versions of gperf like to use the `register` keyword.
+#define register
+
 namespace WebCore {
 
 static const struct HeaderNameString {

Modified: trunk/Source/WebKit/ChangeLog (231752 => 231753)


--- trunk/Source/WebKit/ChangeLog	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebKit/ChangeLog	2018-05-14 12:52:25 UTC (rev 231753)
@@ -1,3 +1,13 @@
+2018-05-14  Zan Dobersek  <zdober...@igalia.com>
+
+        [GTK] REGRESSION(r231170) Build broken with Clang 5.0
+        https://bugs.webkit.org/show_bug.cgi?id=185198
+
+        Reviewed by Michael Catanzaro.
+
+        * Shared/RTCNetwork.h: With std::optional forward declaration gone,
+        explicitly include the WTF Optional.h header.
+
 2018-05-13  Dean Jackson  <d...@apple.com>
 
         WebKit2_Sim-7606.1.17.4 introduced dep cycle

Modified: trunk/Source/WebKit/Shared/RTCNetwork.h (231752 => 231753)


--- trunk/Source/WebKit/Shared/RTCNetwork.h	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/WebKit/Shared/RTCNetwork.h	2018-05-14 12:52:25 UTC (rev 231753)
@@ -29,7 +29,7 @@
 
 #include <WebCore/LibWebRTCMacros.h>
 #include <webrtc/rtc_base/network.h>
-#include <wtf/Forward.h>
+#include <wtf/Optional.h>
 
 namespace IPC {
 class Decoder;

Modified: trunk/Source/cmake/WebKitCompilerFlags.cmake (231752 => 231753)


--- trunk/Source/cmake/WebKitCompilerFlags.cmake	2018-05-14 10:41:07 UTC (rev 231752)
+++ trunk/Source/cmake/WebKitCompilerFlags.cmake	2018-05-14 12:52:25 UTC (rev 231753)
@@ -102,9 +102,20 @@
                                              -Wno-unknown-argument)
     else ()
         WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-fno-exceptions)
-        WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++17
-                                       -fno-rtti)
+        WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-fno-rtti)
 
+        check_cxx_compiler_flag("-std=c++17" CXX_COMPILER_SUPPORTS_CXX17)
+        if (CXX_COMPILER_SUPPORTS_CXX17)
+            WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++17)
+        else ()
+            check_cxx_compiler_flag("-std=c++1z" CXX_COMPILER_SUPPORTS_CXX1Z)
+            if (CXX_COMPILER_SUPPORTS_CXX1Z)
+                WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++1z)
+            else ()
+                message(FATAL_ERROR "Compiler with C++17 support is required")
+            endif ()
+        endif ()
+
         if (WIN32)
             WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-mno-ms-bitfields)
             WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-unknown-pragmas)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to