http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57010
Marc Glisse <glisse at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glisse at gcc dot gnu.org --- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> 2013-04-20 10:47:03 UTC --- (In reply to comment #2) > Mine. I'm testing something like this: Thanks. > @@ -291,8 +291,11 @@ There's this cool diff option called -p that's recommended on the gcc website ;-) > __glibcxx_requires_valid_range(__first, __last); > __glibcxx_requires_heap(__first, __last); > > - --__last; > - std::__pop_heap(__first, __last, __last); > + if (__last - __first > 1) > + { > + --__last; > + std::__pop_heap(__first, __last, __last); > + } > } Is that the same as: if (first != --__last) std::__pop_heap(__first, __last, __last);