Skip to content

Commit 17cd33d

Browse files
committed
Merge commit '50f52d1d2e759e2d78796e5cbc9d62af446c452b' into pr/clang17_fix
2 parents 008161a + 50f52d1 commit 17cd33d

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

cmake/yacma/YACMACompilerLinkerSettings.cmake

+20-2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ if(NOT _YACMACompilerLinkerSettingsRun)
8282
# Configuration bits specific for GCC.
8383
if(YACMA_COMPILER_IS_GNUCXX)
8484
_YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto)
85+
_YACMA_CHECK_ENABLE_CXX_FLAG(-Woverloaded-virtual)
8586
# New in GCC 9.
8687
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Waddress-of-packed-member)
8788
endif()
@@ -109,7 +110,6 @@ if(NOT _YACMACompilerLinkerSettingsRun)
109110
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wc99-designator)
110111
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wreorder-init-list)
111112
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-pointer-div)
112-
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
113113
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
114114
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
115115
# New warnings in clang 11.
@@ -122,13 +122,31 @@ if(NOT _YACMACompilerLinkerSettingsRun)
122122
# NOTE: this is a new flag in Clang 13 which seems to give
123123
# incorrect warnings for UDLs.
124124
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
125+
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-bounds-pointer-arithmetic)
126+
# New warnings in clang 14.
127+
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-parameter)
128+
# NOTE: clang 17 enables by default a new compiler flag called "-fassume-unique-vtables":
129+
#
130+
# https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html#c-language-changes
131+
#
132+
# This flag however seems to be buggy:
133+
#
134+
# https://github.com/llvm/llvm-project/issues/71196
135+
#
136+
# On our part, in several projects we are experiencing Boost.serialization failures when
137+
# (de)serialising derived objects through pointers to bases. Thus, we forcibly disable
138+
# this new flag.
139+
_YACMA_CHECK_ENABLE_CXX_FLAG(-fno-assume-unique-vtables)
125140
endif()
126141

127142
# Common configuration for GCC, clang and Intel.
128143
if(YACMA_COMPILER_IS_CLANGXX OR YACMA_COMPILER_IS_INTELXX OR YACMA_COMPILER_IS_GNUCXX)
129144
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall)
130145
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra)
131-
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
146+
# NOTE: this flag has been superseded by "-Wdelete-non-virtual-dtor"
147+
# (enabled by "-Wall"). See:
148+
# https://gcc.gnu.org/pipermail/gcc-cvs/2022-November/374730.html
149+
# _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
132150
# NOTE: this flag is a bit too chatty, let's disable it for the moment.
133151
#_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept)
134152
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op)

0 commit comments

Comments
 (0)