[Bug c++/86465] [8/9/10/11 Regression] C++17 triggers: ‘’ may be used uninitialized in this function

2020-11-16 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86465

--- Comment #11 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #10)
> Created attachment 49449 [details]
> preprocessed source, unreduced, gzipped
> 
> Here's another example that produces this kind of warning, this time from
> the libstdc++ sources (when built with -Wsystem-headers -Werror)
> 
> It seems to be complaining about the std::allocator object, which is
> an empty class so (1) who cares if it's uninitialized and (2) it's not
> uninitialized.

That one seems to be the same as PR 97840

[Bug c++/86465] [8/9/10/11 Regression] C++17 triggers: ‘’ may be used uninitialized in this function

2020-10-27 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86465

--- Comment #10 from Jonathan Wakely  ---
Created attachment 49449
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49449=edit
preprocessed source, unreduced, gzipped

Here's another example that produces this kind of warning, this time from the
libstdc++ sources (when built with -Wsystem-headers -Werror)

It seems to be complaining about the std::allocator object, which is an
empty class so (1) who cares if it's uninitialized and (2) it's not
uninitialized.

$ ~/gcc/11/bin/g++ -O2 -Wall cow-fs_path.ii -c  
In file included from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/string:55,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/stdexcept:38,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/system_error:40,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/fs_fwd.h:35,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/filesystem:43,
 from
/home/jwakely/src/gcc/libstdc++-v3/src/c++17/fs_path.cc:34,
 from
/home/jwakely/src/gcc/libstdc++-v3/src/c++17/cow-fs_path.cc:26:
In static member function ‘static _CharT* std::basic_string<_CharT, _Traits,
_Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&,
std::forward_iterator_tag) [with _FwdIterator = const char*; _CharT = char;
_Traits = std::char_traits; _Alloc = std::allocator]’,
inlined from ‘static _CharT* std::basic_string<_CharT, _Traits,
_Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&,
std::forward_iterator_tag) [with _FwdIterator = const char*; _CharT = char;
_Traits = std::char_traits; _Alloc = std::allocator]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:589:7,
inlined from ‘static _CharT* std::basic_string<_CharT, _Traits,
_Alloc>::_S_construct(_InIterator, _InIterator, const _Alloc&) [with
_InIterator = const char*; _CharT = char; _Traits = std::char_traits;
_Alloc = std::allocator]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:5151:30,
inlined from ‘std::basic_string<_CharT, _Traits,
_Alloc>::basic_string(const _CharT*, std::basic_string<_CharT, _Traits,
_Alloc>::size_type, const _Alloc&) [with _CharT = char; _Traits =
std::char_traits; _Alloc = std::allocator]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3620:9,
inlined from ‘std::basic_string<_CharT, _Traits,
_Alloc>::basic_string(std::basic_string<_CharT, _Traits, _Alloc>::__sv_wrapper,
const _Alloc&) [with _CharT = char; _Traits = std::char_traits; _Alloc =
std::allocator]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3541:65,
inlined from ‘std::basic_string<_CharT, _Traits,
_Alloc>::basic_string(const _Tp&, const _Alloc&) [with _Tp =
std::basic_string_view;  = void; _CharT = char;
_Traits = std::char_traits; _Alloc = std::allocator]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3731:58,
inlined from ‘std::filesystem::path::path(const _Source&,
std::filesystem::path::format) [with _Source = std::basic_string_view;
_Require = std::filesystem::path]’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/fs_path.h:304:9,
inlined from ‘void
std::filesystem::path::_M_concat(std::basic_string_view)’ at
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/fs_path.h:340:24:
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:604:36:
warning: ‘’ may be used uninitialized [-Wmaybe-uninitialized]
  604 | _Rep* __r = _Rep::_S_create(__dnew, size_type(0), __a);
  | ~~~^~~
In file included from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/string:55,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/stdexcept:38,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/system_error:40,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/fs_fwd.h:35,
 from
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/filesystem:43,
 from
/home/jwakely/src/gcc/libstdc++-v3/src/c++17/fs_path.cc:34,
 from
/home/jwakely/src/gcc/libstdc++-v3/src/c++17/cow-fs_path.cc:26:
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:
In member function ‘void
std::filesystem::path::_M_concat(std::basic_string_view)’:
/home/jwakely/build/powerpc64le-unknown-linux-gnu/libstdc++-v3/include/bits/basic_string.tcc:980:5:
note: by argument 3 of type