When building with gcc on AIX, it seems that gcc does not like the always_inline without the inline keyword.
Such error is observed:
/home/jasonli/llvm/build2/include/c++/v1/fstream: In function 'bool std::__1::__fs::filesystem::detail::{anonymous}::copy_file_impl(std::__1::__fs::filesystem::detail::{anonymous}::FileDescriptor&, std::__1::__fs::filesystem::detail::{anonymous}::FileDescriptor&, std::__1::error_code&)': /home/jasonli/llvm/build2/include/c++/v1/fstream:1329:6: error: inlining failed in call to always_inline 'void std::__1::basic_ifstream<_CharT, _Traits>::__open(int, std::__1::ios_base::openmode) [with _CharT = char; _Traits = std::__1::char_traits<char>]': function body not available /home/jasonli/GitHub/llvm-project/libcxx/src/filesystem/operations.cpp:856:14: note: called from here in.__open(read_fd.fd, ios::binary); ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
So adding the inline keywords in for __open in ifstream and ofstream. That will also make it consistent with __open in basic_filebuf (it seems we added inline there for gcc build as well).
I think you should just copy what close does on lines 1194 and 1555. Namely, put _LIBCPP_INLINE_VISIBILITY (only) on the declaration and inline (only) on the definition. Does that make GCC happy enough?