Skip to content

Commit

Permalink
Disable -Wno-dangling-reference on GCC 13. (#1543)
Browse files Browse the repository at this point in the history
Our Optional<T&> and Expected<T&> trip over the false positive described in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532 , where there are temporary Optional or Expecteds that return references to things outside of their own lifetime that trip the warning.
  • Loading branch information
BillyONeal authored Nov 15, 2024
1 parent 0df8e52 commit d176cbe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ else()

string(APPEND CMAKE_C_FLAGS " -Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers ${DECL_WARNING}")
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra -Wpedantic -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-redundant-move ${DECL_WARNING}")

if(VCPKG_COMPILER STREQUAL "gcc" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14)
# -Wno-dangling-reference results from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532 :(
string(APPEND CMAKE_CXX_FLAGS " -Wno-dangling-reference")
endif()
endif()

if(VCPKG_WARNINGS_AS_ERRORS)
Expand Down

0 comments on commit d176cbe

Please sign in to comment.