https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86516
--- Comment #2 from Paul Gotch ---
I can reproduce this at will with GCC 7.3 it does not reproduce with GCC 8
// Compile with g++ -c -Wextra -Wall -Werror -O3 test.cpp
#include
class Foo
{
public:
Foo() {}
virtual ~Foo()
{
}
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: paulg at chiark dot greenend.org.uk
Target Milestone: ---
This is spurious diagnostic regression in GCC 7 and beyond and is related to
two previous bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80641
--- Comment #10 from Paul Gotch ---
I'm afraid the changes made to libstdc++ have only solved part of the
regression if you say something like
std::vector v;
if(c.size() > 0)
c.resize(c.size() - 1);
then you no longer get a warning in 7.3 how
Assignee: unassigned at gcc dot gnu.org
Reporter: paulg at chiark dot greenend.org.uk
CC: marxin at gcc dot gnu.org
Target Milestone: ---
With the following code fragment
#include
void foo(std::vector & bar)
{
bar.resize(bar.size() - 1);
}
compiled wit