Reported by Ville Voutilainen:
#include <filesystem>
#include <iostream>
using namespace std;
using namespace std::filesystem;
int main() {
cout << boolalpha;
const path p{};
try {
const bool result = create_directories(p);
cout << "create_directories returned " << result << ".\n";
} catch (const filesystem_error& e) {
cout << "create_directories threw " << e.what() << ".\n";
}
}
C:\Temp>cl /EHsc /nologo /W4 /std:c++17 /MTd meow.cpp && meow
meow.cpp
create_directories returned false.
This behavior differs from libstdc++ on Compiler Explorer:
create_directories threw filesystem error: cannot create directories: Invalid argument [].
And from libc++ on Compiler Explorer:
create_directories threw filesystem error: in create_directory: No such file or directory [""].
Reported by Ville Voutilainen:
This behavior differs from libstdc++ on Compiler Explorer:
And from libc++ on Compiler Explorer: