File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,13 @@ endif()
255255# TODO(dbort): Fix these warnings and remove this flag.
256256set (_common_compile_options -Wno-deprecated-declarations -fPIC)
257257
258+ # Clang and GCC's semantics for -Wshadow differ in handling constructor args
259+ # with names that match a constructor field. We want Clang's semantics, as this
260+ # is enforced in certain existing use cases, which have caused reverts.
261+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
262+ list (APPEND _common_compile_options -Wshadow -Werror=shadow)
263+ endif ()
264+
258265# Let files say "include <executorch/path/to/header.h>".
259266# TODO(#6475): This requires/assumes that the repo lives in a directory named
260267# exactly `executorch`. Check the assumption first. Remove this check once we
You can’t perform that action at this time.
0 commit comments