https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532
--- Comment #22 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:ced122b849b8961b854053f0d1ac96983c5802e5 commit r13-6633-gced122b849b8961b854053f0d1ac96983c5802e5 Author: Marek Polacek <pola...@redhat.com> Date: Fri Mar 10 12:23:13 2023 -0500 c++: suppress -Wdangling-reference for std::span [PR107532] std::span is a view and therefore should be treated as a reference wrapper class for the purposes of -Wdangling-reference. I'm not sure there's a pattern that we could check for. PR c++/107532 gcc/cp/ChangeLog: * call.cc (reference_like_class_p): Check for std::span. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference10.C: New test.