https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78483
Bug ID: 78483 Summary: Error: reference to 'on_exit' is ambiguous Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: krzysztof at jusiak dot net Target Milestone: --- It seems that including cstdlib is not adding std namespace, at least for on_exit function, which causes ambiguity with user defined type with the same name. Example. #include <cstdlib> namespace test { struct on_exit {}; } int main() { using namespace test; on_exit{}; // error } Full example here: http://melpon.org/wandbox/permlink/3ddFqVlBGxbB64mF