RESOLVED FIXED Bug 185135
Use some C++17 features
https://bugs.webkit.org/show_bug.cgi?id=185135
Summary Use some C++17 features
JF Bastien
Reported 2018-04-30 09:52:23 PDT
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
Attachments
patch (15.29 KB, patch)
2018-04-30 09:56 PDT, JF Bastien
no flags
patch (16.74 KB, patch)
2018-04-30 10:05 PDT, JF Bastien
no flags
patch (16.73 KB, patch)
2018-04-30 10:20 PDT, JF Bastien
no flags
patch (23.47 KB, patch)
2018-04-30 10:57 PDT, JF Bastien
achristensen: review+
patch (23.98 KB, patch)
2018-04-30 13:37 PDT, JF Bastien
no flags
JF Bastien
Comment 1 2018-04-30 09:56:16 PDT
JF Bastien
Comment 2 2018-04-30 09:58:50 PDT
This built in debug without any troubles for me. I must have done something wrong, let's see what the bots say.
JF Bastien
Comment 3 2018-04-30 10:05:15 PDT
Created attachment 339122 [details] patch Fix libstdc++ build.
JF Bastien
Comment 4 2018-04-30 10:20:37 PDT
Created attachment 339124 [details] patch Fix feature test macro for libstdc++.
JF Bastien
Comment 5 2018-04-30 10:57:02 PDT
Darin Adler
Comment 6 2018-04-30 13:27:12 PDT
Comment on attachment 339129 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=339129&action=review > Source/WebCore/platform/URLParser.cpp:2500 > + URLParser::LCharBuffer output; Why do we need a URLParser:: prefix in a URLParser member function template?
JF Bastien
Comment 7 2018-04-30 13:37:59 PDT
Created attachment 339144 [details] patch I'm building for ARM locally, I'm not sure I get why this error occurs, seems unrelated. (In reply to Darin Adler from comment #6) > Comment on attachment 339129 [details] > patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=339129&action=review > > > Source/WebCore/platform/URLParser.cpp:2500 > > + URLParser::LCharBuffer output; > > Why do we need a URLParser:: prefix in a URLParser member function template? We don't, I was over-enthusiastic in find-and-replace. It's now gone.
JF Bastien
Comment 8 2018-04-30 13:51:05 PDT
(In reply to JF Bastien from comment #7) > Created attachment 339144 [details] > patch > > I'm building for ARM locally, I'm not sure I get why this error occurs, > seems unrelated. My local build works just fine, and looking at the code I just don't see anything wrong. I'll assume that ToT was borked for a short bit.
WebKit Commit Bot
Comment 9 2018-04-30 14:18:05 PDT
Comment on attachment 339144 [details] patch Clearing flags on attachment: 339144 Committed r231170: <https://trac.webkit.org/changeset/231170>
WebKit Commit Bot
Comment 10 2018-04-30 14:18:06 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 11 2018-04-30 14:19:28 PDT
JF Bastien
Comment 12 2018-04-30 15:13:15 PDT
I'll move the main Xcode code configurations to C++17 in a follow-up, it'll require a bit more code change it looks like.
Note You need to log in before you can comment on or make changes to this bug.