https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
Bug ID: 108517 Summary: std::sort of empty range yield "warning: 'this' pointer is null" Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hanicka at hanicka dot net Target Milestone: --- Bug in GCC 11.1-13 (including trunk) https://compiler-explorer.com/z/EEjeaKfv7 I couldn't minimize it further. Lowering optimization level will make the warning gone.