-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed as not planned
Closed as not planned
Copy link
Labels
invalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a buglibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
Consider the following code:
#ifdef __cpp_lib_filesystem
#include <filesystem>
#endif
#include <fstream>
int main() {
#ifdef __cpp_lib_filesystem
auto path = std::filesystem::current_path().string();
#endif
return 0;
}
Compiling in C++23 mode works both with Clang 19 and 20 (version details below):
clang++ -std=c++23 -stdlib=libc++ fs.cpp
Compiling in C++26 mode fails with the following error:
$ clang++ -std=c++26 -stdlib=libc++ fs.cpp
fs.cpp:9:30: error: no member named 'current_path' in namespace 'std::filesystem'
9 | auto path = std::filesystem::current_path().string();
| ~~~~~~~~~~~~~~~~~^
1 error generated.
only when using Clang 20 on Arch Linux:
$ clang++ --version
clang version 20.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
but compiles fine when using Clang 19 on FreeBSD:
% clang++ --version
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
Target: x86_64-unknown-freebsd14.3
Thread model: posix
InstalledDir: /usr/bin
Metadata
Metadata
Assignees
Labels
invalidResolved as invalid, i.e. not a bugResolved as invalid, i.e. not a buglibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.