https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532
--- Comment #15 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Hmm, so it's this line const FrameMetadata::Plane &meta = buffer->metadata().planes()[i]; and we complain because we have libcamera::Span<const libcamera::FrameMetadata::Plane>::operator[] (&TARGET_EXPR <D.153699, libcamera::FrameMetadata::planes ((const struct FrameMetadata *) libcamera::FrameBuffer::metadata (NON_LVALUE_EXPR <VIEW_CONVERT_EXPR<struct FrameBuffer *>(buffer)>))>, (size_type) VIEW_CONVERT_EXPR<unsigned int>(i)) and the argument to operator[] is a temporary of type Span. Span is not a reference wrapper class so I *think* this is a valid warning.