[libcxx-commits] [libcxx] [libc++] Make std::filesystem::canonical throw when given empty path (PR #77223)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Jan 7 04:35:14 PST 2024
mordante wrote:
Thanks for your contribution!
> Fixes #77170
>
> As noted in the issue, `std::filesystem::canonical` returns the current path when given `""` while an error is expected. To fix that, this PR adds a check for empty paths in `std::filesystem::canonical` and raise an error accordingly. Since `std::filesystem::weakly_canonical` uses this function and should not raise an error when given an empty path, it was updated to return an empty path instead of the results of canonical.
Can you remove the notes below from the commit message, to avoid accidentally merging them in the commit?
> Note: Running clang-format on the [canonical.pass.cpp](https://github.com/llvm/llvm-project/compare/main...Yuki-cpp:llvm-project:fix-77170-canonical-should-throw?expand=1#diff-0111faeef5a805a4fa6b7fa5a93698f1009684f17dbf80698c81c70da7fcc284) file produced formatting different than the rest of the file. As such, to conform with the [Coding Standard](https://llvm.org/docs/CodingStandards.html) I haven't formatted that file automatically but rather kept the style of the file intact. Let me know if I missed something there and I'll gladly fix it.
we recently have formatted our code except for the tests. That will done in the future. For now keeping the existing code is fine.
> Note 2: Might as well mention now that I do not have commit access
No problem. Can you make sure your e-mail address is not hidden.
https://github.com/llvm/llvm-project/pull/77223
More information about the libcxx-commits
mailing list