[kokoro] Switch to Clang 13.0.1
This fixes a Clang bug that is triggered when we switch to C++20.
Change-Id: I6787f2b08be0055c83c3dcc3fa999bde5e31b55d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/148022
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
diff --git a/infra/kokoro/linux/docker.sh b/infra/kokoro/linux/docker.sh
index 3f92aac..49add3b 100755
--- a/infra/kokoro/linux/docker.sh
+++ b/infra/kokoro/linux/docker.sh
@@ -132,7 +132,7 @@
COMMON_CMAKE_FLAGS+=" -DTINT_RANDOMIZE_HASHES=1"
if [ "$BUILD_TOOLCHAIN" == "clang" ]; then
- using clang-10.0.0
+ using clang-13.0.1
COMMON_CMAKE_FLAGS+=" -DTINT_BUILD_FUZZERS=1"
COMMON_CMAKE_FLAGS+=" -DTINT_BUILD_SPIRV_TOOLS_FUZZER=1"
COMMON_CMAKE_FLAGS+=" -DTINT_BUILD_AST_FUZZER=1"
diff --git a/src/tint/utils/macros/compiler.h b/src/tint/utils/macros/compiler.h
index 6d31ca8..c279f53 100644
--- a/src/tint/utils/macros/compiler.h
+++ b/src/tint/utils/macros/compiler.h
@@ -32,6 +32,7 @@
#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
#define TINT_DISABLE_WARNING_DEPRECATED __pragma(warning(disable : 4996))
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER /* currently no-op */
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
@@ -59,6 +60,8 @@
#define TINT_DISABLE_WARNING_WEAK_VTABLES _Pragma("clang diagnostic ignored \"-Wweak-vtables\"")
#define TINT_DISABLE_WARNING_FLOAT_EQUAL _Pragma("clang diagnostic ignored \"-Wfloat-equal\"")
#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER \
+ _Pragma("clang diagnostic ignored \"-Wreserved-identifier\"")
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
@@ -79,13 +82,14 @@
#define TINT_DISABLE_WARNING_CONSTANT_OVERFLOW /* currently no-op */
#define TINT_DISABLE_WARNING_MAYBE_UNINITIALIZED \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-#define TINT_DISABLE_WARNING_NEWLINE_EOF /* currently no-op */
-#define TINT_DISABLE_WARNING_OLD_STYLE_CAST /* currently no-op */
-#define TINT_DISABLE_WARNING_SIGN_CONVERSION /* currently no-op */
-#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */
-#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
-#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
-#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_NEWLINE_EOF /* currently no-op */
+#define TINT_DISABLE_WARNING_OLD_STYLE_CAST /* currently no-op */
+#define TINT_DISABLE_WARNING_SIGN_CONVERSION /* currently no-op */
+#define TINT_DISABLE_WARNING_UNREACHABLE_CODE /* currently no-op */
+#define TINT_DISABLE_WARNING_WEAK_VTABLES /* currently no-op */
+#define TINT_DISABLE_WARNING_FLOAT_EQUAL /* currently no-op */
+#define TINT_DISABLE_WARNING_DEPRECATED /* currently no-op */
+#define TINT_DISABLE_WARNING_RESERVED_IDENTIFIER /* currently no-op */
// clang-format off
#define TINT_BEGIN_DISABLE_WARNING(name) \
diff --git a/src/tint/utils/socket/BUILD.cmake b/src/tint/utils/socket/BUILD.cmake
index 4ae7f61..ce6f11b 100644
--- a/src/tint/utils/socket/BUILD.cmake
+++ b/src/tint/utils/socket/BUILD.cmake
@@ -31,6 +31,10 @@
utils/socket/socket.h
)
+tint_target_add_dependencies(tint_utils_socket lib
+ tint_utils_macros
+)
+
if(IS_WIN)
tint_target_add_external_dependencies(tint_utils_socket lib
"winsock"
diff --git a/src/tint/utils/socket/BUILD.gn b/src/tint/utils/socket/BUILD.gn
index 3365f6a..6f5c84e 100644
--- a/src/tint/utils/socket/BUILD.gn
+++ b/src/tint/utils/socket/BUILD.gn
@@ -31,7 +31,7 @@
"socket.cc",
"socket.h",
]
- deps = []
+ deps = [ "${tint_src_dir}/utils/macros" ]
if (is_win) {
deps += [ "${tint_src_dir}:winsock" ]
diff --git a/src/tint/utils/socket/socket.cc b/src/tint/utils/socket/socket.cc
index 54cb462..d11624c 100644
--- a/src/tint/utils/socket/socket.cc
+++ b/src/tint/utils/socket/socket.cc
@@ -14,6 +14,7 @@
#include "src/tint/utils/socket/socket.h"
+#include "src/tint/utils/macros/compiler.h"
#include "src/tint/utils/socket/rwmutex.h"
#if defined(_WIN32)
@@ -295,9 +296,12 @@
} else {
const auto timeout_us = timeout_ms * 1000;
+ // Note: These macros introduce identifiers that start with `__`.
+ TINT_BEGIN_DISABLE_WARNING(RESERVED_IDENTIFIER);
fd_set fdset;
FD_ZERO(&fdset);
FD_SET(socket, &fdset);
+ TINT_END_DISABLE_WARNING(RESERVED_IDENTIFIER);
timeval tv;
tv.tv_sec = timeout_us / 1000000;