aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2022-06-28 16:09:21 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-06-30 14:16:27 +0100
commit1eef21ccfa5988a23a3b71a99613f27ea6a26da6 (patch)
tree144bbcd52978c765c87546bcfbe758a8253c5271 /gcc/expr.cc
parent6c96b14a19a9e6c365eacc59868a866b99f9786d (diff)
downloadgcc-1eef21ccfa5988a23a3b71a99613f27ea6a26da6.zip
gcc-1eef21ccfa5988a23a3b71a99613f27ea6a26da6.tar.gz
gcc-1eef21ccfa5988a23a3b71a99613f27ea6a26da6.tar.bz2
libstdc++: Improve exceptions thrown from fs::temp_directory_path
Currently the throwing overload of fs::temp_directory_path() will discard the path that was obtained from the environment. When it fails because the path doesn't resolve to a directory you get an unhelpful error like: filesystem error: temp_directory_path: Not a directory It would be better to also print the path in that case, e.g. filesystem error: temp_directory_path: Not a directory [/home/bob/tmp] libstdc++-v3/ChangeLog: * src/c++17/fs_ops.cc (fs::temp_directory_path()): Include path in exception. (fs::temp_directory_path(error_code&)): Rearrange to more closely match the structure of the first overload. * src/filesystem/ops.cc (fs::temp_directory_path): Likewise. * testsuite/27_io/filesystem/operations/temp_directory_path.cc: Check that exception contains the path. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Likewise.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions