[Bug c++/99735] [modules] in system headers: non-template type ‘rebind_alloc’ used as a template

alexander.lelyakin at googlemail dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 24 19:27:53 GMT 2021


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

--- Comment #1 from Alexander Lelyakin <alexander.lelyakin at googlemail dot com> ---
There is a shorter sequence:
----
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header string
/usr/local/bin/g++ -std=c++20 -fmodules-ts -x c++-system-header filesystem
----
In file included from /usr/local/include/c++/11.0.1/filesystem:45:
/usr/local/include/c++/11.0.1/bits/fs_path.h: In instantiation of
‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = char; _Traits = std::char_traits<char>; _Allocator =
std::allocator<char>]’:
/usr/local/include/c++/11.0.1/bits/fs_path.h:1165:33:   required from here
/usr/local/include/c++/11.0.1/bits/fs_path.h:1131:13: error: non-template type
‘rebind_alloc’ used as a template
 1131 |       using _Alloc2 = typename allocator_traits<_Allocator>::template
      |             ^~~~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
 1133 |       basic_string<value_type, char_traits<value_type>, _Alloc2>
__str(__a);
      |                                                                  ^~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
/usr/local/include/c++/11.0.1/bits/fs_path.h: In instantiation of
‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = wchar_t; _Traits = std::char_traits<wchar_t>; _Allocator =
std::allocator<wchar_t>]’:
/usr/local/include/c++/11.0.1/bits/fs_path.h:1170:36:   required from here
/usr/local/include/c++/11.0.1/bits/fs_path.h:1131:13: error: non-template type
‘rebind_alloc’ used as a template
 1131 |       using _Alloc2 = typename allocator_traits<_Allocator>::template
      |             ^~~~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
 1133 |       basic_string<value_type, char_traits<value_type>, _Alloc2>
__str(__a);
      |                                                                  ^~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
/usr/local/include/c++/11.0.1/bits/fs_path.h: In instantiation of
‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = char8_t; _Traits = std::char_traits<char8_t>; _Allocator =
std::allocator<char8_t>]’:
/usr/local/include/c++/11.0.1/bits/fs_path.h:1176:36:   required from here
/usr/local/include/c++/11.0.1/bits/fs_path.h:1131:13: error: non-template type
‘rebind_alloc’ used as a template
 1131 |       using _Alloc2 = typename allocator_traits<_Allocator>::template
      |             ^~~~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
 1133 |       basic_string<value_type, char_traits<value_type>, _Alloc2>
__str(__a);
      |                                                                  ^~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
/usr/local/include/c++/11.0.1/bits/fs_path.h: In instantiation of
‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = char16_t; _Traits = std::char_traits<char16_t>; _Allocator =
std::allocator<char16_t>]’:
/usr/local/include/c++/11.0.1/bits/fs_path.h:1185:37:   required from here
/usr/local/include/c++/11.0.1/bits/fs_path.h:1131:13: error: non-template type
‘rebind_alloc’ used as a template
 1131 |       using _Alloc2 = typename allocator_traits<_Allocator>::template
      |             ^~~~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
 1133 |       basic_string<value_type, char_traits<value_type>, _Alloc2>
__str(__a);
      |                                                                  ^~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
/usr/local/include/c++/11.0.1/bits/fs_path.h: In instantiation of
‘std::__cxx11::basic_string<_CharT, _Traits, _Allocator>
std::filesystem::__cxx11::path::generic_string(const _Allocator&) const [with
_CharT = char32_t; _Traits = std::char_traits<char32_t>; _Allocator =
std::allocator<char32_t>]’:
/usr/local/include/c++/11.0.1/bits/fs_path.h:1189:37:   required from here
/usr/local/include/c++/11.0.1/bits/fs_path.h:1131:13: error: non-template type
‘rebind_alloc’ used as a template
 1131 |       using _Alloc2 = typename allocator_traits<_Allocator>::template
      |             ^~~~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
 1133 |       basic_string<value_type, char_traits<value_type>, _Alloc2>
__str(__a);
      |                                                                  ^~~~~
/usr/local/include/c++/11.0.1/bits/fs_path.h:1133:66: error: non-template type
‘rebind_alloc’ used as a template
/usr/local/include/c++/11.0.1/filesystem: warning: not writing module
‘/usr/local/include/c++/11.0.1/filesystem’ due to errors
----
g++ (GCC) 11.0.1 20210324 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


More information about the Gcc-bugs mailing list