-
Notifications
You must be signed in to change notification settings - Fork 12.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when including boost headers [clang-diagnostic-missing-template-arg-list-after-template-kw] #101079
Comments
Clang is correctly rejecting the boost code. The From a quick look at the code, the I would suggest reporting the issue to boost/qvm. See also #94194. |
If this is a normal situation, then why does clang compiler not produce this error? |
Perhaps you've configured clang-tidy incorrectly? |
@llvm/issue-subscribers-c-1 Author: Bogdan (FoxLightning)
boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
82 | quat_traits<Q>::template write_element_idx(i, q) = s;
(I don't include this header)
appear if use in cmake project with LLVM version 20.0.0git latest Mac OS file(GLOB_RECURSE CPP_FILES *.cpp)
include_directories(${PROJECT_SOURCE_DIR}/src/include)
add_executable(${PROJECT_NAME} ${CPP_FILES})
if (WIN32)
target_link_libraries(
${PROJECT_NAME} PRIVATE SDL3main
)
endif()
# third party libs
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL3::SDL3
SDL3_image::SDL3_image
SDL3_ttf::SDL3_ttf
Boost::geometry
)
# clang-tidy setup
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
if(CLANG_TIDY_EXE)
set(CLANG_TIDY_CONFIG_FILE ${PROJECT_SOURCE_DIR}/.clang-tidy)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-config-file=${CLANG_TIDY_CONFIG_FILE}")
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
message(STATUS "Using clang-tidy configuration: ${CLANG_TIDY_CONFIG_FILE}")
else()
message(WARNING "clang-tidy not found!")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY}") cmake_minimum_required(VERSION 3.16)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
# clang-tidy crashes on C++20 during linting boost/geometry headers
# even if headers dont include in HeaderFilterRegex
set(CMAKE_CXX_STANDARD 17)
project(GameOne VERSION 0.1)
# Black magic from one internet guy, need for run SDL3_image
# (Probably usefull only for MacOS)
enable_language(OBJC)
add_subdirectory(lib/SDL)
add_subdirectory(lib/SDL_image)
add_subdirectory(lib/SDL_ttf)
add_subdirectory(lib/boost)
add_subdirectory(src)
<img width="461" alt="image" src="https://github.com/user-attachments/assets/c409be76-f5bb-477b-9fc1-fee7b421a7c0"> /Users/bohdanlysychenko/GameOne/lib/boost/libs/qvm/include/boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
82 | quat_traits<Q>::template write_element_idx(i, q) = s;
| ^
/Users/bohdanlysychenko/GameOne/lib/boost/libs/qvm/include/boost/qvm/quat_traits.hpp:92:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
92 | quat_traits<Q>::template write_element_idx(i, q, s);
| ^
4 warnings and 2 errors generated.
Error while processing /Users/bohdanlysychenko/GameOne/src/cpp/GameBase/BaseController.cpp.
Suppressed 4 warnings (4 with check filters).
Found compiler error(s).
make[2]: *** [src/CMakeFiles/GameOne.dir/cpp/GameBase/BaseController.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/GameOne.dir/all] Error 2
make: *** [all] Error 2 |
@llvm/issue-subscribers-clang-tidy Author: Bogdan (FoxLightning)
boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
82 | quat_traits<Q>::template write_element_idx(i, q) = s;
(I don't include this header)
appear if use in cmake project with LLVM version 20.0.0git latest Mac OS file(GLOB_RECURSE CPP_FILES *.cpp)
include_directories(${PROJECT_SOURCE_DIR}/src/include)
add_executable(${PROJECT_NAME} ${CPP_FILES})
if (WIN32)
target_link_libraries(
${PROJECT_NAME} PRIVATE SDL3main
)
endif()
# third party libs
target_link_libraries(${PROJECT_NAME} PRIVATE
SDL3::SDL3
SDL3_image::SDL3_image
SDL3_ttf::SDL3_ttf
Boost::geometry
)
# clang-tidy setup
find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
if(CLANG_TIDY_EXE)
set(CLANG_TIDY_CONFIG_FILE ${PROJECT_SOURCE_DIR}/.clang-tidy)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-config-file=${CLANG_TIDY_CONFIG_FILE}")
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
message(STATUS "Using clang-tidy configuration: ${CLANG_TIDY_CONFIG_FILE}")
else()
message(WARNING "clang-tidy not found!")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY}") cmake_minimum_required(VERSION 3.16)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
# clang-tidy crashes on C++20 during linting boost/geometry headers
# even if headers dont include in HeaderFilterRegex
set(CMAKE_CXX_STANDARD 17)
project(GameOne VERSION 0.1)
# Black magic from one internet guy, need for run SDL3_image
# (Probably usefull only for MacOS)
enable_language(OBJC)
add_subdirectory(lib/SDL)
add_subdirectory(lib/SDL_image)
add_subdirectory(lib/SDL_ttf)
add_subdirectory(lib/boost)
add_subdirectory(src)
<img width="461" alt="image" src="https://github.com/user-attachments/assets/c409be76-f5bb-477b-9fc1-fee7b421a7c0"> /Users/bohdanlysychenko/GameOne/lib/boost/libs/qvm/include/boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
82 | quat_traits<Q>::template write_element_idx(i, q) = s;
| ^
/Users/bohdanlysychenko/GameOne/lib/boost/libs/qvm/include/boost/qvm/quat_traits.hpp:92:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
92 | quat_traits<Q>::template write_element_idx(i, q, s);
| ^
4 warnings and 2 errors generated.
Error while processing /Users/bohdanlysychenko/GameOne/src/cpp/GameBase/BaseController.cpp.
Suppressed 4 warnings (4 with check filters).
Found compiler error(s).
make[2]: *** [src/CMakeFiles/GameOne.dir/cpp/GameBase/BaseController.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/GameOne.dir/all] Error 2
make: *** [all] Error 2 |
Yes, indeed the problem was in the wrong arguments for the linter. I missed --extra-arg-before --extra-arg-before=-Wno-missing-template-arg-list-after-template-kw Thanks everyone for your help |
boost/qvm/quat_traits.hpp:82:30: error: a template argument list is expected after a name prefixed by the template keyword [clang-diagnostic-missing-template-arg-list-after-template-kw]
82 | quat_traits
appear if use in cmake project with
boost built from source v1.85
tried c++ standard 17 20 23 - same result
LLVM version 20.0.0git
Optimized build. (on 18 was crash)
latest Mac OS
cpu m1pro
The text was updated successfully, but these errors were encountered: