Work around bug in gcc 11.4.0 causing spurious compile error

This commit is contained in:
Davis King 2023-08-05 12:24:42 -04:00
parent 9a9b4af6c5
commit efae642813
1 changed files with 2 additions and 2 deletions

View File

@ -177,8 +177,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-Wno-strict-overflow) add_compile_options(-Wno-strict-overflow)
add_compile_options(-Wno-maybe-uninitialized) add_compile_options(-Wno-maybe-uninitialized)
if (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 11.3.0) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL 11.4.0)
# GCC 11.3 wrongly yields this warning: # These versions of gcc wrongly yield this warning:
# dlib::row_major_layout::layout<double, 0, 2, dlib::memory_manager_stateless_kernel_1<char> >::data with nonzero offset 8 [-Werror=free-nonheap-object] # dlib::row_major_layout::layout<double, 0, 2, dlib::memory_manager_stateless_kernel_1<char> >::data with nonzero offset 8 [-Werror=free-nonheap-object]
# 61 | delete [] item; # 61 | delete [] item;
# Which by inspection of the dlib::row_major_layout::layout class you can see is clearly incorrect, as `data` is most # Which by inspection of the dlib::row_major_layout::layout class you can see is clearly incorrect, as `data` is most