Skip to content

Commit 943763a

Browse files
committed
Swift: add -Wno-pragma-once-outside-header to check
1 parent 28d79ee commit 943763a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

swift/extractor/infra/file/BUILD.bazel

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ genrule(
1818
# see if https://cplusplus.github.io/LWG/issue3657 is fixed with the current compiler or not
1919
# if fixed, PathHash.h.workaround will not compile
2020
cmd = "\n".join([
21-
"if $(CC) -c -x c++ -std=c++17 $(rootpath PathHash.h.workaround) -o /dev/null &> /dev/null; then",
21+
"if $(CC) -c -x c++ -std=c++17 -Wno-pragma-once-outside-header \\",
22+
" $(rootpath PathHash.h.workaround) -o /dev/null &> /dev/null; then",
2223
" cp $(rootpath PathHash.h.workaround) $@",
2324
"else",
2425
" cp $(rootpath PathHash.h.fixed) $@",

swift/extractor/infra/file/PathHash.h.workaround

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
// std::variant would not kick in (we use std::filesystem::path in a variant used as a map key).
1111
namespace std {
1212
template <>
13-
struct std::hash<std::filesystem::path> {
14-
std::size_t operator()(const std::filesystem::path& path) const { return hash_value(path); }
13+
struct hash<filesystem::path> {
14+
size_t operator()(const filesystem::path& path) const { return hash_value(path); }
1515
};
16+
1617
} // namespace std

0 commit comments

Comments
 (0)