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

            Bug ID: 92064
           Summary: operator/ not resolved for directory_entry and const
                    char*
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: penkrat8 at gmail dot com
  Target Milestone: ---

Created attachment 47020
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47020&action=edit
example

Both std::filesystem::directory_entry and const char* can be implicitly
converted to std::filesystem::path, however operator/ for these types doesn't
get resolved.

test.cpp: In function ‘int main()’:
test.cpp:6:26: error: no match for ‘operator/’ (operand types are ‘const
std::filesystem::__cxx11::directory_entry’ and ‘const char [5]’)
    6 |         std::cout << dir / "file";
      |                      ~~~ ^ ~~~~~~
      |                      |     |
      |                      |     const char [5]
      |                      const std::filesystem::__cxx11::directory_entry

There is no such problem in gcc 8.2.0 so it's a regression between 8.2.0 and
9.2.0.

Reply via email to