https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97048

Tony Guilfoyle <tonyguil at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tonyguil at gmail dot com

--- Comment #1 from Tony Guilfoyle <tonyguil at gmail dot com> ---
Source file foo.cpp:

#include <vector>
struct T
  {
  void* p ;
  std::vector<char> a[10] ;
  } ;
void f (T& t, const std::vector<char>& u, int i)
  {
  std::vector<char>& v = t.a[i] ;
  std::vector<char> w (u.begin(), u.end()) ;
  v.resize (v.size() - w.size()) ; // <-- Warning generated here
  }

Command line: g++ -std=c++20 -Wall -O3 -c -o foo.obj foo.cpp

g++ --version: g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht
Sanders) 12.2.0

Problem: Spurious warning emitted:

specified bound between 9223372036854775808 and 18446744073709551614 exceeds
maximum object size 9223372036854775807 [-Wstringop-overflow=]

Reply via email to