[Bug c++/84667] unreasonable refusal to use assignment operator method
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Mar 2 15:27:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84667
David Malcolm <dmalcolm at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dmalcolm at gcc dot gnu.org
--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
FWIW, I'm also seeing:
auxtypes.cpp: In member function ‘aux::xstrbuf<xchar>&
aux::xstrbuf<xchar>::operator=(const char*) [with xchar = short int]’:
auxtypes.cpp:240:3: warning: ‘blen’ is used uninitialized in this function
[-Wuninitialized]
assignByLength( blen, s ); // side effect input; base_str::length
^~~~~~~~~~~~~~
auxtypes.cpp: In member function ‘aux::xstrbuf<xchar>&
aux::xstrbuf<xchar>::operator=(const char*) [with xchar = int]’:
auxtypes.cpp:240:3: warning: ‘blen’ is used uninitialized in this function
[-Wuninitialized]
assignByLength( blen, s ); // side effect input; base_str::length
^~~~~~~~~~~~~~
auxtypes.cpp: In member function ‘aux::xstrbuf<xchar>&
aux::xstrbuf<xchar>::operator=(const char*) [with xchar = signed char]’:
auxtypes.cpp:240:3: warning: ‘blen’ is used uninitialized in this function
[-Wuninitialized]
assignByLength( blen, s ); // side effect input; base_str::length
^~~~~~~~~~~~~~
utf8len presumably is meant to write back to &blen in the line above, but the
decl and defn of the:
strsize utf8len( const char *buf, strsize *byte_length = NULL );
overload are labelled "pure". Removing the "pure" fixes that warning.
More information about the Gcc-bugs
mailing list