Skip to content

Commit 430fb5c

Browse files
committed
test-resultstree: fixed -Wuseless-cast GCC warnings in moc_*.cpp
example: ``` /home/runner/work/cppcheck/cppcheck/cmake.output.tinyxml2/gui/test/resultstree/__/__/moc_threadhandler.cpp: In static member function ‘static void ThreadHandler::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)’: /home/runner/work/cppcheck/cppcheck/cmake.output.tinyxml2/gui/test/resultstree/__/__/moc_threadhandler.cpp:100:51: error: useless cast to type ‘using _t = void (class ThreadHandler::*)()’ {aka ‘void (class ThreadHandler::*)()’} [-Werror=useless-cast] 100 | if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&ThreadHandler::done)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
1 parent 077f087 commit 430fb5c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

gui/test/resultstree/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
4545
endif()
4646
# caused by mocks
4747
target_compile_options_safe(test-resultstree -Wno-missing-noreturn)
48+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
49+
# caused by mocks
50+
target_compile_options_safe(test-resultstree -Wno-useless-cast)
4851
endif()
4952

5053
if (REGISTER_GUI_TESTS)

0 commit comments

Comments
 (0)