Check for overflow in filesystem::last_write_time
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Sep 2016 18:02:25 +0000 (19:02 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 28 Sep 2016 18:02:25 +0000 (19:02 +0100)
commitfd5effb17e5f800fcaf54fc1223b77fa764b7f72
tree8768b2c522ddcd29a552fd09838f7179502163de
parent93c9b105be716efa6ede687f5bc6af6d5224a0de
Check for overflow in filesystem::last_write_time

* include/experimental/bits/fs_fwd.h (file_time_type): Simplify
definition.
* src/filesystem/ops.cc (file_time): Take error_code parameter and
check for overflow.
(do_copy_file, last_write_time): Pass error_code in file_time calls.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
New.
* testsuite/util/testsuite_fs.h (scoped_file): Define RAII helper.

From-SVN: r240587
libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/bits/fs_fwd.h
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/testsuite_fs.h