public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/94242] New: filesystem::path::generic_string() only works with std::allocator
@ 2020-03-20 21:09 redi at gcc dot gnu.org
  2020-03-20 21:10 ` [Bug libstdc++/94242] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-20 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94242
           Summary: filesystem::path::generic_string() only works with
                    std::allocator
           Product: gcc
           Version: 9.3.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#include <filesystem>

template<typename T>
struct A
{
  using value_type = T;

  T* allocate(std::size_t n) { return std::allocator<T>().allocate(n); }
  void deallocate(T* p, std::size_t n) { std::allocator<T>().deallocate(p, n);
}
};

std::filesystem::path p;
std::basic_string<char, std::char_traits<char>, A<char>> s
  = p.generic_string<char, std::char_traits<char>, A<char>>();


Compiled with -std=gnu++17:

In file included from /home/jwakely/gcc/10/include/c++/10.0.1/filesystem:45,
                 from gen.cc:1:
/home/jwakely/gcc/10/include/c++/10.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 = A<char>]':
gen.cc:14:61:   required from here
/home/jwakely/gcc/10/include/c++/10.0.1/bits/fs_path.h:1129:19: error: no
matching function for call to
'std::__cxx11::basic_string<char>::basic_string(const A<char>&)'
 1129 |       string_type __str(__a);
      |                   ^~~~~

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-07 11:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 21:09 [Bug libstdc++/94242] New: filesystem::path::generic_string() only works with std::allocator redi at gcc dot gnu.org
2020-03-20 21:10 ` [Bug libstdc++/94242] " redi at gcc dot gnu.org
2020-03-21 22:05 ` cvs-commit at gcc dot gnu.org
2020-03-21 22:15 ` redi at gcc dot gnu.org
2020-08-07 10:40 ` cvs-commit at gcc dot gnu.org
2020-08-07 11:43 ` cvs-commit at gcc dot gnu.org
2020-08-07 11:43 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).