https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100384
Bug ID: 100384 Summary: Compiling in c++17 mode breaks compilation of functions named visit() Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: aacid at kde dot org Target Milestone: --- Created attachment 50733 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50733&action=edit main.cpp The attached code fails to compile with g++ --std=c++17 main.cpp I've tried with gcc 11.1 too and it fails too. To me it seems a bug in the implementation in which std::visit is leaking into the non std:: namespace, but maybe it's a bug in C++ specification?