Use some C++17 features
authorjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Apr 2018 21:17:59 +0000 (21:17 +0000)
committerjfbastien@apple.com <jfbastien@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Apr 2018 21:17:59 +0000 (21:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185135

Reviewed by Alex Christensen.

.:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* Source/cmake/WebKitCompilerFlags.cmake:

Source/WebCore:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* DerivedSources.make:
* platform/URLParser.cpp: work around an odd GCC 6 bug with class
  static value as a template parameter.
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasForbiddenHostCodePoint):
(WebCore::URLParser::parseHostAndPort):
* platform/URLParser.h:

Source/WebKit:

As discussed here [0] let's move WebKit to a subset of C++17. We
now require GCC 6 [1] which means that, according to [2] we can
use the following C++17 language features (I removed some
uninteresting ones):

 - New auto rules for direct-list-initialization
 - static_assert with no message
 - typename in a template template parameter
 - Nested namespace definition
 - Attributes for namespaces and enumerators
 - u8 character literals
 - Allow constant evaluation for all non-type template arguments
 - Fold Expressions
 - Unary fold expressions and empty parameter packs
 - __has_include in preprocessor conditional
 - Differing begin and end types in range-based for
 - Improving std::pair and std::tuple

Consult the Tony Tables [3] to see before / after examples.

Of course we can use any library feature if we're willing to
import them to WTF (and they don't require language support).

  [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
  [1]: https://trac.webkit.org/changeset/231152/webkit
  [2]: https://en.cppreference.com/w/cpp/compiler_support
  [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md

* Configurations/Base.xcconfig:
* DerivedSources.make:
* PlatformMac.cmake:

Source/WebKitLegacy:

* PlatformMac.cmake:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:

Source/WTF:

* wtf/StdLibExtras.h: libstdc++ doesn't say it's C++17 when it
defines std::conjunction. Use the feature test macro instead.

Tools:

* DumpRenderTree/PlatformMac.cmake:
* gtk/ycm_extra_conf.py:
(FlagsForFile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
ChangeLog
Source/WTF/ChangeLog
Source/WTF/wtf/StdLibExtras.h
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/platform/URLParser.cpp
Source/WebCore/platform/URLParser.h
Source/WebKit/ChangeLog
Source/WebKit/Configurations/Base.xcconfig
Source/WebKit/DerivedSources.make
Source/WebKit/PlatformMac.cmake
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformMac.cmake
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig
Source/cmake/WebKitCompilerFlags.cmake
Tools/ChangeLog
Tools/DumpRenderTree/PlatformMac.cmake
Tools/gtk/ycm_extra_conf.py

index 652df6f..30e3ec1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        As discussed here [0] let's move WebKit to a subset of C++17. We
+        now require GCC 6 [1] which means that, according to [2] we can
+        use the following C++17 language features (I removed some
+        uninteresting ones):
+
+         - New auto rules for direct-list-initialization
+         - static_assert with no message
+         - typename in a template template parameter
+         - Nested namespace definition
+         - Attributes for namespaces and enumerators
+         - u8 character literals
+         - Allow constant evaluation for all non-type template arguments
+         - Fold Expressions
+         - Unary fold expressions and empty parameter packs
+         - __has_include in preprocessor conditional
+         - Differing begin and end types in range-based for
+         - Improving std::pair and std::tuple
+
+        Consult the Tony Tables [3] to see before / after examples.
+
+        Of course we can use any library feature if we're willing to
+        import them to WTF (and they don't require language support).
+
+
+          [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
+          [1]: https://trac.webkit.org/changeset/231152/webkit
+          [2]: https://en.cppreference.com/w/cpp/compiler_support
+          [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
+
+        * Source/cmake/WebKitCompilerFlags.cmake:
+
 2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [CMake] Require GCC 6
index 99f2b8f..5f004a5 100644 (file)
@@ -1,3 +1,13 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        * wtf/StdLibExtras.h: libstdc++ doesn't say it's C++17 when it
+        defines std::conjunction. Use the feature test macro instead.
+
 2018-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Use WordLock instead of std::mutex for Threading
index 7a4fa2d..49f2e29 100644 (file)
@@ -534,7 +534,7 @@ ALWAYS_INLINE constexpr typename remove_reference<T>::type&& move(T&& value)
     return move(forward<T>(value));
 }
 
-#if __cplusplus < 201703L && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918)
+#if __cplusplus < 201703L && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) && !defined(__cpp_lib_logical_traits)
 template<class...> struct wtf_conjunction_impl;
 template<> struct wtf_conjunction_impl<> : true_type { };
 template<class B0> struct wtf_conjunction_impl<B0> : B0 { };
index 33511a8..895e2ef 100644 (file)
@@ -1,3 +1,48 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        As discussed here [0] let's move WebKit to a subset of C++17. We
+        now require GCC 6 [1] which means that, according to [2] we can
+        use the following C++17 language features (I removed some
+        uninteresting ones):
+
+         - New auto rules for direct-list-initialization
+         - static_assert with no message
+         - typename in a template template parameter
+         - Nested namespace definition
+         - Attributes for namespaces and enumerators
+         - u8 character literals
+         - Allow constant evaluation for all non-type template arguments
+         - Fold Expressions
+         - Unary fold expressions and empty parameter packs
+         - __has_include in preprocessor conditional
+         - Differing begin and end types in range-based for
+         - Improving std::pair and std::tuple
+
+        Consult the Tony Tables [3] to see before / after examples.
+
+        Of course we can use any library feature if we're willing to
+        import them to WTF (and they don't require language support).
+
+
+          [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
+          [1]: https://trac.webkit.org/changeset/231152/webkit
+          [2]: https://en.cppreference.com/w/cpp/compiler_support
+          [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
+
+        * DerivedSources.make:
+        * platform/URLParser.cpp: work around an odd GCC 6 bug with class
+          static value as a template parameter.
+        (WebCore::URLParser::percentDecode):
+        (WebCore::URLParser::domainToASCII):
+        (WebCore::URLParser::hasForbiddenHostCodePoint):
+        (WebCore::URLParser::parseHostAndPort):
+        * platform/URLParser.h:
+
 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
index db75786..ac0b6f1 100644 (file)
@@ -1015,19 +1015,19 @@ ifeq ($(USE_LLVM_TARGET_TRIPLES_FOR_CLANG),YES)
        TARGET_TRIPLE_FLAGS=-target $(CURRENT_ARCH)-$(LLVM_TARGET_TRIPLE_VENDOR)-$(LLVM_TARGET_TRIPLE_OS_VERSION)$(LLVM_TARGET_TRIPLE_SUFFIX)
 endif
 
-ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
+ifeq ($(shell $(CC) -std=gnu++17 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
     WTF_PLATFORM_IOS = 1
 else
     WTF_PLATFORM_IOS = 0
 endif
 
-ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep USE_APPLE_INTERNAL_SDK | cut -d' ' -f3), 1)
+ifeq ($(shell $(CC) -std=gnu++17 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep USE_APPLE_INTERNAL_SDK | cut -d' ' -f3), 1)
     USE_APPLE_INTERNAL_SDK = 1
 else
     USE_APPLE_INTERNAL_SDK = 0
 endif
 
-ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ENABLE_ORIENTATION_EVENTS | cut -d' ' -f3), 1)
+ifeq ($(shell $(CC) -std=gnu++17 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ENABLE_ORIENTATION_EVENTS | cut -d' ' -f3), 1)
     ENABLE_ORIENTATION_EVENTS = 1
 endif
 
index 44d82b9..449f3e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -2495,9 +2495,9 @@ std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator
 }
 
 template<typename CharacterType>
-Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const LChar* input, size_t length, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
+URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
 {
-    Vector<LChar, defaultInlineBufferSize> output;
+    LCharBuffer output;
     output.reserveInitialCapacity(length);
     
     for (size_t i = 0; i < length; ++i) {
@@ -2517,9 +2517,9 @@ Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const
     return output;
 }
     
-Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const LChar* input, size_t length)
+URLParser::LCharBuffer URLParser::percentDecode(const LChar* input, size_t length)
 {
-    Vector<LChar, defaultInlineBufferSize> output;
+    LCharBuffer output;
     output.reserveInitialCapacity(length);
     
     for (size_t i = 0; i < length; ++i) {
@@ -2538,9 +2538,9 @@ Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const
     return output;
 }
 
-template<typename CharacterType> std::optional<Vector<LChar, URLParser::defaultInlineBufferSize>> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
+template<typename CharacterType> std::optional<URLParser::LCharBuffer> URLParser::domainToASCII(StringImpl& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
 {
-    Vector<LChar, defaultInlineBufferSize> ascii;
+    LCharBuffer ascii;
     if (domain.isAllASCII()) {
         size_t length = domain.length();
         if (domain.is8Bit()) {
@@ -2584,7 +2584,7 @@ template<typename CharacterType> std::optional<Vector<LChar, URLParser::defaultI
     return std::nullopt;
 }
 
-bool URLParser::hasForbiddenHostCodePoint(const Vector<LChar, URLParser::defaultInlineBufferSize>& asciiDomain)
+bool URLParser::hasForbiddenHostCodePoint(const URLParser::LCharBuffer& asciiDomain)
 {
     for (size_t i = 0; i < asciiDomain.size(); ++i) {
         if (isForbiddenHostCodePoint(asciiDomain[i]))
@@ -2733,7 +2733,7 @@ bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator)
     
     const auto hostBegin = iterator;
     
-    Vector<LChar, defaultInlineBufferSize> utf8Encoded;
+    LCharBuffer utf8Encoded;
     for (; !iterator.atEnd(); ++iterator) {
         if (UNLIKELY(isTabOrNewline(*iterator))) {
             syntaxViolation(hostBegin);
@@ -2752,7 +2752,7 @@ bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator)
         // FIXME: Check error.
         utf8Encoded.append(buffer, offset);
     }
-    Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin);
+    LCharBuffer percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin);
     String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size());
     if (domain.isNull())
         return false;
@@ -2761,7 +2761,7 @@ bool URLParser::parseHostAndPort(CodePointIterator<CharacterType> iterator)
     auto asciiDomain = domainToASCII(*domain.impl(), hostBegin);
     if (!asciiDomain || hasForbiddenHostCodePoint(asciiDomain.value()))
         return false;
-    Vector<LChar, defaultInlineBufferSize>& asciiDomainValue = asciiDomain.value();
+    LCharBuffer& asciiDomainValue = asciiDomain.value();
     const LChar* asciiDomainCharacters = asciiDomainValue.data();
 
     auto address = parseIPv4Host(hostBegin, CodePointIterator<LChar>(asciiDomainValue.begin(), asciiDomainValue.end()));
index 06d01c1..6023bb6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -67,7 +67,8 @@ private:
     const void* m_inputBegin { nullptr };
 
     bool m_didSeeSyntaxViolation { false };
-    const static size_t defaultInlineBufferSize = 2048;
+    static constexpr size_t defaultInlineBufferSize = 2048;
+    using LCharBuffer = Vector<LChar, defaultInlineBufferSize>;
 
     template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const TextEncoding&);
     template<typename CharacterType> void parseAuthority(CodePointIterator<CharacterType>);
@@ -97,11 +98,11 @@ private:
     template<typename UnsignedIntegerType> void appendNumberToASCIIBuffer(UnsignedIntegerType);
     template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&);
     template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&);
-    template<typename CharacterType> std::optional<Vector<LChar, defaultInlineBufferSize>> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
-    template<typename CharacterType> Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
-    static Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t);
+    template<typename CharacterType> std::optional<LCharBuffer> domainToASCII(StringImpl&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
+    template<typename CharacterType> LCharBuffer percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
+    static LCharBuffer percentDecode(const LChar*, size_t);
     static std::optional<String> formURLDecode(StringView input);
-    static bool hasForbiddenHostCodePoint(const Vector<LChar, defaultInlineBufferSize>&);
+    static bool hasForbiddenHostCodePoint(const LCharBuffer&);
     void percentEncodeByte(uint8_t);
     void appendToASCIIBuffer(UChar32);
     void appendToASCIIBuffer(const char*, size_t);
index 52b0b4d..2fda504 100644 (file)
@@ -1,3 +1,43 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        As discussed here [0] let's move WebKit to a subset of C++17. We
+        now require GCC 6 [1] which means that, according to [2] we can
+        use the following C++17 language features (I removed some
+        uninteresting ones):
+
+         - New auto rules for direct-list-initialization
+         - static_assert with no message
+         - typename in a template template parameter
+         - Nested namespace definition
+         - Attributes for namespaces and enumerators
+         - u8 character literals
+         - Allow constant evaluation for all non-type template arguments
+         - Fold Expressions
+         - Unary fold expressions and empty parameter packs
+         - __has_include in preprocessor conditional
+         - Differing begin and end types in range-based for
+         - Improving std::pair and std::tuple
+
+        Consult the Tony Tables [3] to see before / after examples.
+
+        Of course we can use any library feature if we're willing to
+        import them to WTF (and they don't require language support).
+
+
+          [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
+          [1]: https://trac.webkit.org/changeset/231152/webkit
+          [2]: https://en.cppreference.com/w/cpp/compiler_support
+          [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
+
+        * Configurations/Base.xcconfig:
+        * DerivedSources.make:
+        * PlatformMac.cmake:
+
 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
index 6354498..b07a5b1 100644 (file)
@@ -128,7 +128,7 @@ SUPPORTS_TEXT_BASED_API[sdk=appletv*] = NO;
 SUPPORTS_TEXT_BASED_API[sdk=watch*] = NO;
 
 OTHER_TAPI_FLAGS = $(OTHER_TAPI_FLAGS_$(WK_COCOA_TOUCH));
-OTHER_TAPI_FLAGS_cocoatouch = -x objective-c++ -std=c++14 -fno-rtti -DRELEASE_WITHOUT_OPTIMIZATIONS;
+OTHER_TAPI_FLAGS_cocoatouch = -x objective-c++ -std=c++17 -fno-rtti -DRELEASE_WITHOUT_OPTIMIZATIONS;
 TAPI_VERIFY_MODE[sdk=iphone*] = Pedantic;
 
 // This is required to make LLVM_TARGET_TRIPLE_SUFFIX propagate into scripts.
index 1e4cc51..f78d027 100644 (file)
@@ -268,7 +268,7 @@ AUTOMATION_PROTOCOL_OUTPUT_FILES = \
 #
 
 ifeq ($(OS),MACOS)
-ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
+ifeq ($(shell $(CC) -std=gnu++17 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
        AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform iOS
 else
        AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform macOS
index 2fa81a9..3d63120 100644 (file)
@@ -1,4 +1,4 @@
-add_definitions("-ObjC++ -std=c++14")
+add_definitions("-ObjC++ -std=c++17")
 find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices)
 find_library(CARBON_LIBRARY Carbon)
 find_library(QUARTZ_LIBRARY Quartz)
index 688b84e..f5f4d56 100644 (file)
@@ -1,3 +1,12 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        * PlatformMac.cmake:
+
 2018-04-16  Youenn Fablet  <youenn@apple.com>
 
         Use NetworkLoadChecker to handle synchronous HTTP loads
index 0cbe38f..abc9f3a 100644 (file)
@@ -396,7 +396,7 @@ set(C99_FILES
 foreach (_file ${WebKitLegacy_SOURCES})
     list(FIND C99_FILES ${_file} _c99_index)
     if (${_c99_index} EQUAL -1)
-        set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++14")
+        set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++17")
     else ()
         set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS -std=c99)
     endif ()
index 56fd0cb..252eb10 100644 (file)
@@ -1,3 +1,12 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/WebKitLegacy.xcconfig:
+
 2018-04-27  Chris Dumez  <cdumez@apple.com>
 
         Use WindowProxy instead of DOMWindow in our IDL
index e6d3f1b..5596736 100644 (file)
@@ -139,5 +139,5 @@ WK_QUOTED_OVERRIDE_FRAMEWORKS_DIR_YES = "$(WK_OVERRIDE_FRAMEWORKS_DIR)";
 SUPPORTS_TEXT_BASED_API[sdk=iphone*] = $(USE_INTERNAL_SDK);
 SUPPORTS_TEXT_BASED_API[sdk=appletv*] = NO;
 SUPPORTS_TEXT_BASED_API[sdk=watch*] = NO;
-OTHER_TAPI_FLAGS[sdk=iphone*] = -x objective-c++ -std=c++14 -fno-rtti -DRELEASE_WITHOUT_OPTIMIZATIONS;
+OTHER_TAPI_FLAGS[sdk=iphone*] = -x objective-c++ -std=c++17 -fno-rtti -DRELEASE_WITHOUT_OPTIMIZATIONS;
 TAPI_VERIFY_MODE[sdk=iphone*] = Pedantic;
index cd17ddd..79cae5f 100644 (file)
@@ -102,7 +102,7 @@ if (COMPILER_IS_GCC_OR_CLANG)
                                              -Wno-unknown-argument)
     else ()
         WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-fno-exceptions)
-        WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++14
+        WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-std=c++17
                                        -fno-rtti)
 
         if (WIN32)
index 394b4f8..faed572 100644 (file)
@@ -1,3 +1,14 @@
+2018-04-30  JF Bastien  <jfbastien@apple.com>
+
+        Use some C++17 features
+        https://bugs.webkit.org/show_bug.cgi?id=185135
+
+        Reviewed by Alex Christensen.
+
+        * DumpRenderTree/PlatformMac.cmake:
+        * gtk/ycm_extra_conf.py:
+        (FlagsForFile):
+
 2018-04-30  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Use WordLock instead of std::mutex for Threading
index 5d6a399..71b3676 100644 (file)
@@ -106,11 +106,11 @@ foreach (_file ${DumpRenderTree_ObjC_SOURCES})
 endforeach ()
 
 foreach (_file ${DumpRenderTree_Cpp_SOURCES} ${TestNetscapePlugIn_Cpp_SOURCES})
-    set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-std=c++14")
+    set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-std=c++17")
 endforeach ()
 
 foreach (_file ${DumpRenderTree_ObjCpp_SOURCES} ${TestNetscapePlugIn_ObjCpp_SOURCES})
-    set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++14")
+    set_source_files_properties(${_file} PROPERTIES COMPILE_FLAGS "-ObjC++ -std=c++17")
 endforeach ()
 
 set(DumpRenderTree_RESOURCES
index 2b85cc6..c1309bc 100644 (file)
@@ -93,7 +93,7 @@ def FlagsForFile(filename, **kwargs):
         'do_cache': (Boolean) True if the result should be cached.
     """
 
-    result = {'flags': ['-std=c++11', '-x', 'c++'], 'do_cache': True}
+    result = {'flags': ['-std=c++17', '-x', 'c++'], 'do_cache': True}
 
     # Headers can't be built, so we get the source file flags instead.
     if filename.endswith('.h'):