Skip to content

Commit

Permalink
disable -Werror=non-template-friend in llvm/ADT/PagedVector.h:215:59
Browse files Browse the repository at this point in the history
Reported as the upstream issue:
llvm/llvm-project#67942
  • Loading branch information
marxin committed Oct 5, 2023
1 parent 9f237d6 commit f9f7573
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,17 @@ check_cxx_compiler_flag(
SUPPORTS_MAYBE_UNINITIALIZED
)

# XXX remove in the future once LLVM 17 gets released
check_cxx_compiler_flag(
"-Wclass-memaccess"
SUPPORTS_CLASS_MEMACCESS
)

check_cxx_compiler_flag(
"-Wnon-template-friend"
SUPPORTS_NON_TEMPLATE_FRIEND
)


if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# XXX figure out how to get "-std=c++17 -fno-rtti" from LLVM. That's how we
Expand All @@ -179,6 +184,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=class-memaccess")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=class-memaccess")
endif()
if(SUPPORTS_NON_TEMPLATE_FRIEND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=non-template-friend")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=non-template-friend")
endif()

set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -O3 -g")
Expand Down

0 comments on commit f9f7573

Please sign in to comment.