Repository navigation
fix(Simulation): avoid GCC dangling-reference errors on absl::Span - #206
Conversation
… errors GCC 13+ reports -Wdangling-reference when taking a reference to an element of a temporary absl::Span. The reference points into the owner's storage, so it is a false positive, but it breaks -Werror builds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cpp-Linter Report
|
Builds with GCC 13+ fail under
-Werrorwith-Wdangling-referencewhen taking a reference to an element of a temporaryabsl::Span(e.g.problem.materials()[id]). The reference points into the owner's storage, so it is a false positive.This stores the span in a local before taking the element reference. No behaviour change.
Companion PR in OpenGeode-GeosciencesIO on branch
fix/gcc-dangling-reference.🤖 Generated with Claude Code