Summary: | std::get for tuple should be declared before struct TupleHash is defined | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yoshiaki Jitsukawa <yoshiaki.jitsukawa> | ||||||
Component: | Web Template Framework | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED DUPLICATE | ||||||||
Severity: | Normal | CC: | benjamin, cdumez, cmarcelo, commit-queue, dbates, don.olmstead, Hironori.Fujii, mjs | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Yoshiaki Jitsukawa
2017-03-16 11:08:13 PDT
Created attachment 304663 [details]
patch
Created attachment 304664 [details]
patch
Comment on attachment 304664 [details]
patch
What file fails to compile without this? We would ideally not add another #include to this widely-included file if we can get away with just including tuple before wtf/HashFunctions.h in the file that instantiates TupleHash
JSClassRef.cpp, for example. Adding #include <tuple> to it works fine. The completeness of HashFunctions.h doesn't matter? #include <utility> template <typename T> auto myget(const T& t) { return std::get<0>(t); } #include <tuple> int foo() { return myget(std::tuple<int, int, int>(1, 2, 3)); } --- Here's a simplified code which causes a compilation error with clang while MSVC is ok. There seems to be two factors in this issue: - <tuple> is implicitly included or not - compiler does two phase lookup or not On mac and ubuntu, <tuple> is implicitly included in HashFunctions.h. On windows, <tuple> is not included there but cl compiler doesn't do two phase lookup so webkit can build. However if we use clang-cl with "-fno-delayed-template-parsing", which enables two phase lookup, the compiler reports compilation errors of std::get(std::tuple), so there's still a problem of header inclusion. Anyways, if toolchain supports, passing "-fdelayed-template-parsing" (not "-fno-delayed-template-parsing") can be a workaround. *** This bug has been marked as a duplicate of bug 179926 *** Comment on attachment 304664 [details]
patch
Unflagging and obsoleting since this was resolved as a dupe.
|