Skip to content

Commit

Permalink
Move some ignores to the code
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Nov 20, 2024
1 parent d62357e commit f69c782
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App
)
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# GCC reports dangling reference when using std::invoke with data members
set_source_files_properties(
${LIBMAMBA_SOURCE_DIR}/solver/problems_graph.cpp
PROPERTIES COMPILE_FLAGS -Wno-error=dangling-reference
)
endif()

foreach(script ${SHELL_SCRIPTS})
list(APPEND LIBMAMBA_SOURCES shell_scripts/${script}.cpp)
endforeach()
Expand Down
6 changes: 6 additions & 0 deletions libmamba/src/solver/problems_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ namespace mamba::solver
return CompressedProblemsGraph::NamedList<O>(tmp.begin(), tmp.end());
}

// GCC reports dangling reference when using std::invoke with data members
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"

template <typename T>
auto invoke_version(T&& e) -> decltype(auto)
{
Expand Down Expand Up @@ -328,6 +332,8 @@ namespace mamba::solver
}
}

#pragma GCC diagnostic pop

/**
* Detect if a type has a ``name`` member (function).
*/
Expand Down

0 comments on commit f69c782

Please sign in to comment.