https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #10 from CVS Commits ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
:
https://gcc.gnu.org/g:a8ae5dbc60eedade3514e51e3cb35fd28ec1d4c8
commit r10-9982-ga8ae5dbc60eedade3514e51e3cb35fd28ec1d4c8
Author: Jonathan
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #9 from CVS Commits ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
:
https://gcc.gnu.org/g:96205c97294d5db94bd89cd731830058d9c49abd
commit r11-8741-g96205c97294d5db94bd89cd731830058d9c49abd
Author: Jonathan
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #8 from Martin Sebor ---
The warning depends on the optimizer for eliminating unreachable code but not
all of it can be. For example, the abort below isn't. In theory it could be
but with longer strings that require memory
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #7 from CVS Commits ---
The master branch has been updated by Jonathan Wakely :
https://gcc.gnu.org/g:4d3eaeb4f505b0838c673ee28e7dba8687fc8272
commit r12-2285-g4d3eaeb4f505b0838c673ee28e7dba8687fc8272
Author: Jonathan Wakely
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #6 from Jonathan Wakely ---
And that change only helps the testcase in comment 1, not the original one in
comment 0.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #5 from Jonathan Wakely ---
This would be better, because it avoids the redundant range checking done when
this->compare calls this->substr:
{
const auto __len = this->size();
const auto __xlen = __x.size();
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
--- Comment #4 from Jonathan Wakely ---
It seems acceptable, but isn't the diagnostic bug still there if users write
exactly the same code? The use of npos there is valid.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101361
Martin Sebor changed:
What|Removed |Added
Last reconfirmed||2021-07-12
CC|