Globally disable -Wdangling-reference for GCC-13+
This commit is contained in:
parent
57aebfb42d
commit
02bd1dc2f1
2 changed files with 4 additions and 5 deletions
|
|
@ -30,6 +30,10 @@ endif()
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
||||||
# gcc gives way too many false positives on -Wmaybe-uninitialized
|
# gcc gives way too many false positives on -Wmaybe-uninitialized
|
||||||
list(APPEND PSEMEK_CXX_FLAGS -Wno-maybe-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()
|
endif()
|
||||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
|
||||||
# -Wdtor-name gives false-positive on audio::engine::impl::~impl
|
# -Wdtor-name gives false-positive on audio::engine::impl::~impl
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,6 @@ namespace psemek::ecs
|
||||||
return reinterpret_cast<Component *>(column->data() + detail::stride<std::remove_const_t<Component>>() * row_);
|
return reinterpret_cast<Component *>(column->data() + detail::stride<std::remove_const_t<Component>>() * row_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
|
||||||
#pragma GCC diagnostic ignored "-Wdangling-reference"
|
|
||||||
|
|
||||||
template <typename Component>
|
template <typename Component>
|
||||||
Component & accessor::get()
|
Component & accessor::get()
|
||||||
{
|
{
|
||||||
|
|
@ -121,8 +118,6 @@ namespace psemek::ecs
|
||||||
throw component_not_found_exception(typeid(std::remove_const_t<Component>), table_->entity_handles()[row_]);
|
throw component_not_found_exception(typeid(std::remove_const_t<Component>), table_->entity_handles()[row_]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic pop
|
|
||||||
|
|
||||||
template <typename Component>
|
template <typename Component>
|
||||||
bool accessor::contains() const
|
bool accessor::contains() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue