[Bug c++/100465] New: Overloading operator+= and including filesystem causes conflicting overload compilation error
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 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 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 )
[Bug c++/100465] Overloading operator+= and including filesystem causes conflicting overload compilation error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100465 --- Comment #1 from Ramchandra Apte --- (In reply to Ramchandra Apte from comment #0) > Created attachment 50771 [details] > Minimal example > > Adding an templated function overload for operator+= and including > 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 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 ) Note that the code works with Clang with libstdc++, so I believe this is a frontend bug.