[Bug c++/100465] New: Overloading operator+= and including filesystem causes conflicting overload compilation error

ramkapte at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri May 7 02:39:32 GMT 2021


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

            Bug ID: 100465
           Summary: Overloading operator+= and including filesystem causes
                    conflicting overload compilation error
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ramkapte at gmail dot com
  Target Milestone: ---

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

Adding an templated function overload for operator+= and including <filesystem>
causes a compilation error about conflicting overloads. The code works on GCC
versions <= 9.3 but does not work on GCC versions after that. The code works on
MSVC and Clang, so I believe this is a compiler bug. I'm not sure, but I don't
think the internal code of <filesystem> ought to be seeing the overload in the
global namespace.

See attached error.cpp for minimal example.

(Godbolt for error.cpp: https://godbolt.org/z/ccPvqf9K9 )


More information about the Gcc-bugs mailing list