https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71337
Bug ID: 71337 Summary: temp_directory_path(error_code&) shouldn't throw from !exists(p) || !is_directory(p) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: eric at efcs dot ca Target Milestone: --- Most of the time these two function will not throw. However if 'p' points to a directory that the user doesn't have permission to read then they will. For example: create_directories("/tmp/foo/bar"); permissions("/tmp/foo", perms::none); setenv("TMPDIR", "/tmp/foo/bar", 1); std::error_code ec; temp_directory_path(ec); // THROWS!