https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83891
Bug ID: 83891
Summary: std::filesystem::path::is_absolute for Windows
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: faithandbrave at gmail dot com
Target Milestone: ---
Current is_absolute implementation is follow:
inline bool
path::is_absolute() const
{
#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
return has_root_name();
#else
return has_root_directory();
#endif
}
This means path("C:").is_absolute() == true. However, Windows GetFullPathName()
API says:
> If you specify "U:" the path returned is the current directory on the "U:\"
> drive
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364963(v=vs.85).aspx
I think path("C:").is_absolute() should return false.
As additional information, libc++/msvc experimental implementation returns
false.