Skip to content

Commit 20d62a8

Browse files
pytorchbotmalfet
andauthored
Fix tensorpipe compilation with clang-17 (pytorch#153091)
Fix tensorpipe compilation with clang-17 (pytorch#151344) By suppressing `missing-template-arg-list-after-template-kw` warning, which seems to be required to compile Google's libnop, which is in a semi-abandoned state now ``` In file included from /Users/malfet/git/pytorch/pytorch/third_party/tensorpipe/third_party/libnop/include/nop/base/variant.h:21: /Users/malfet/git/pytorch/pytorch/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:241:30: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 241 | index_ = value_.template Construct(std::forward<Args>(args)...); | ^ /Users/malfet/git/pytorch/pytorch/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:258:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 258 | if (!value_.template Assign(TypeTag<T>{}, index_, std::forward<U>(value))) { | ^ /Users/malfet/git/pytorch/pytorch/third_party/tensorpipe/third_party/libnop/include/nop/types/variant.h:265:26: error: a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 265 | if (!value_.template Assign(index_, std::forward<T>(value))) { | ^ 3 errors generated. ``` Fixes pytorch#151316 Pull Request resolved: pytorch#151344 Approved by: https://github.com/ZainRizvi, https://github.com/seemethere (cherry picked from commit 331423e) Co-authored-by: Nikita Shulga <[email protected]>
1 parent cd885e7 commit 20d62a8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/Dependencies.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,9 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
11711171
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
11721172
endif()
11731173
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
1174+
# Suppress warning to unblock libnop comiplation by clang-17
1175+
# See https://github.com/pytorch/pytorch/issues/151316
1176+
target_compile_options_if_supported(tensorpipe -Wno-missing-template-arg-list-after-template-kw)
11741177
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.0.0")
11751178
unset(CMAKE_POLICY_VERSION_MINIMUM)
11761179
endif()

0 commit comments

Comments
 (0)