flang
flang copied to clipboard
Support UNC paths on Windows
From https://github.com/flang-compiler/flang/pull/1127#issuecomment-914347599:
[Flang is] missing support for UNC paths like \machine\mountpoint\file, which to my best knowledge are mainly used when files on a non-local drive are to be referenced (network drives).
See https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#fully-qualified-vs-relative-paths for some more information.
Please also note that this documentation might give the impression that a path like \example is considered absolute. This is usually not true as far as I know. E.g. both PathIsRelative from the Windows API as well as std::filesystem::path::is_relative with Microsofts STL implementation will return true for such a path. (To my understanding it is absolute to the current drive, but not fully qualified since the drive is not specified.)
Not sure whether you want to apply the necessary changes in this PR or whether you prefer to merge the current, partial support and open an issue for the remaining UNC path detection.