diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bb66990..14fa3cf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU")) # gcc gives way too many false positives on -Wmaybe-uninitialized list(APPEND PSEMEK_CXX_FLAGS -Wno-maybe-uninitialized) + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13) + # gcc-13 gives false positive -Wdangling-reference in ecs::accessor::get() + list(APPEND PSEMEK_CXX_FLAGS -Wno-dangling-reference) + endif() endif() if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) # -Wdtor-name gives false-positive on audio::engine::impl::~impl diff --git a/libs/ecs/include/psemek/ecs/accessor.hpp b/libs/ecs/include/psemek/ecs/accessor.hpp index daa681fb..333e535b 100644 --- a/libs/ecs/include/psemek/ecs/accessor.hpp +++ b/libs/ecs/include/psemek/ecs/accessor.hpp @@ -102,9 +102,6 @@ namespace psemek::ecs return reinterpret_cast(column->data() + detail::stride>() * row_); } - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdangling-reference" - template Component & accessor::get() { @@ -121,8 +118,6 @@ namespace psemek::ecs throw component_not_found_exception(typeid(std::remove_const_t), table_->entity_handles()[row_]); } - #pragma GCC diagnostic pop - template bool accessor::contains() const {