[libcxx-commits] [PATCH] D91141: [9/N] [libcxx] Implement the stat function family on top of native windows APIs

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 18 13:15:58 PST 2020


mstorsjo added inline comments.


================
Comment at: libcxx/src/filesystem/operations.cpp:409
+
+int set_errno(int e = GetLastError()) {
+  errno = static_cast<int>(__win_err_to_errc(e));
----------------
amccarth wrote:
> Whoa!  I thought default argument values had to be compile-time constants.  I've never seen this done before.  Is this a newer C++ feature?
No idea actually, I just tried it and it worked. If it wouldn't, it'd be trivial to make a parameterless overload of the function that just calls `set_errno(GetLastError())` anyway.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91141/new/

https://reviews.llvm.org/D91141



More information about the libcxx-commits mailing list