This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Implement ISO/IEC TS 18822 C++ File system TS
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Daniel Krügler <daniel dot kruegler at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 1 May 2015 18:55:40 +0100
- Subject: Re: [patch] Implement ISO/IEC TS 18822 C++ File system TS
- Authentication-results: sourceware.org; auth=none
- References: <20150430173236 dot GT3618 at redhat dot com> <CAGNvRgAzHFMbsw3PLzEb4zprmGnZiLJux+vJCxY9kC-gCOhvLg at mail dot gmail dot com>
On 01/05/15 19:03 +0200, Daniel Krügler wrote:
- There are three places where you refer to std::__addressof and one
where you refer to std::addressof. Is this difference intentional?
No, I'll make them all use __addressof.
- I found all together six non-uglified usages of parameter name "rhs"
in the synopsis of directory_iterator and
recursive_directory_iterator.
All names should be uglified as of this patch, which also fixes the
dg-require-filesystem-ts check so the tests actually run again(!)
Tested x86_64-linux and powerpc64le-linux, committed to trunk.
I'll address the other issues ASAP (I'm making a number of changes to
the #else branches in ops.cc and dir.cc).
Thanks very much for the thorough review.
commit 503fb9b4fe01b0c34d47590ed2384db179e04a57
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri May 1 18:41:38 2015 +0100
* include/experimental/fs_dir.h: Fix use of non-reserved names.
* include/experimental/fs_ops.h: Likewise.
* include/experimental/fs_path.h: Likewise.
* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Use
C++11 when checking for support.
diff --git a/libstdc++-v3/include/experimental/fs_dir.h b/libstdc++-v3/include/experimental/fs_dir.h
index 0538fd2..d46d41b 100644
--- a/libstdc++-v3/include/experimental/fs_dir.h
+++ b/libstdc++-v3/include/experimental/fs_dir.h
@@ -180,14 +180,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
directory_options __options, error_code& __ec) noexcept
: directory_iterator(__p, __options, &__ec) { }
- directory_iterator(const directory_iterator& rhs) = default;
+ directory_iterator(const directory_iterator& __rhs) = default;
- directory_iterator(directory_iterator&& rhs) noexcept = default;
+ directory_iterator(directory_iterator&& __rhs) noexcept = default;
~directory_iterator() = default;
- directory_iterator& operator=(const directory_iterator& rhs) = default;
- directory_iterator& operator=(directory_iterator&& rhs) noexcept = default;
+ directory_iterator& operator=(const directory_iterator& __rhs) = default;
+ directory_iterator& operator=(directory_iterator&& __rhs) noexcept = default;
const directory_entry& operator*() const;
const directory_entry* operator->() const { return &**this; }
@@ -269,9 +269,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
// modifiers
recursive_directory_iterator&
- operator=(const recursive_directory_iterator& rhs) noexcept;
+ operator=(const recursive_directory_iterator& __rhs) noexcept;
recursive_directory_iterator&
- operator=(recursive_directory_iterator&& rhs) noexcept;
+ operator=(recursive_directory_iterator&& __rhs) noexcept;
recursive_directory_iterator& operator++();
recursive_directory_iterator& increment(error_code& __ec) noexcept;
diff --git a/libstdc++-v3/include/experimental/fs_ops.h b/libstdc++-v3/include/experimental/fs_ops.h
index 0878fbb..6b7d470 100644
--- a/libstdc++-v3/include/experimental/fs_ops.h
+++ b/libstdc++-v3/include/experimental/fs_ops.h
@@ -53,8 +53,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
path absolute(const path& __p, const path& __base = current_path());
path canonical(const path& __p, const path& __base = current_path());
- path canonical(const path& p, error_code& ec);
- path canonical(const path& p, const path& base, error_code& ec);
+ path canonical(const path& __p, error_code& __ec);
+ path canonical(const path& __p, const path& __base, error_code& __ec);
inline void
copy(const path& __from, const path& __to)
@@ -64,8 +64,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
copy(const path& __from, const path& __to, error_code& __ec) noexcept
{ copy(__from, __to, copy_options::none, __ec); }
- void copy(const path& __from, const path& __to, copy_options options);
- void copy(const path& __from, const path& __to, copy_options options,
+ void copy(const path& __from, const path& __to, copy_options __options);
+ void copy(const path& __from, const path& __to, copy_options __options,
error_code& __ec) noexcept;
inline bool
@@ -239,12 +239,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
file_time_type last_write_time(const path& __p);
file_time_type last_write_time(const path& __p, error_code& __ec) noexcept;
- void last_write_time(const path& __p, file_time_type new_time);
- void last_write_time(const path& __p, file_time_type new_time,
+ void last_write_time(const path& __p, file_time_type __new_time);
+ void last_write_time(const path& __p, file_time_type __new_time,
error_code& __ec) noexcept;
- void permissions(const path& __p, perms prms);
- void permissions(const path& __p, perms prms, error_code& __ec) noexcept;
+ void permissions(const path& __p, perms __prms);
+ void permissions(const path& __p, perms __prms, error_code& __ec) noexcept;
path read_symlink(const path& __p);
path read_symlink(const path& __p, error_code& __ec);
diff --git a/libstdc++-v3/include/experimental/fs_path.h b/libstdc++-v3/include/experimental/fs_path.h
index ffc4926..11b0561 100644
--- a/libstdc++-v3/include/experimental/fs_path.h
+++ b/libstdc++-v3/include/experimental/fs_path.h
@@ -423,9 +423,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
void _M_split_cmpts();
void _M_trim();
- void _M_add_root_name(size_t n);
- void _M_add_root_dir(size_t pos);
- void _M_add_filename(size_t pos, size_t n);
+ void _M_add_root_name(size_t __n);
+ void _M_add_root_dir(size_t __pos);
+ void _M_add_filename(size_t __pos, size_t __n);
string_type _M_pathname;
@@ -681,10 +681,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
iterator operator--(int) { auto __tmp = *this; --_M_cur; return __tmp; }
friend bool operator==(const iterator& __lhs, const iterator& __rhs)
- { return __lhs.equals(__rhs); }
+ { return __lhs._M_equals(__rhs); }
friend bool operator!=(const iterator& __lhs, const iterator& __rhs)
- { return !__lhs.equals(__rhs); }
+ { return !__lhs._M_equals(__rhs); }
private:
friend class path;
@@ -697,7 +697,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
: _M_path(__path), _M_cur(), _M_at_end(__at_end)
{ }
- bool equals(iterator) const;
+ bool _M_equals(iterator) const;
const path* _M_path;
path::_List::const_iterator _M_cur;
@@ -749,7 +749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
inline path::_Path<_CharT*, _CharT*>&
path::operator+=(_CharT __x)
{
- auto* __addr = std::addressof(__x);
+ auto* __addr = std::__addressof(__x);
return concat(__addr, __addr + 1);
}
@@ -990,7 +990,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
inline bool
- path::iterator::equals(iterator __rhs) const
+ path::iterator::_M_equals(iterator __rhs) const
{
if (_M_path != __rhs._M_path)
return false;
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 7ae4f3f..7d8f282 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -1896,6 +1896,8 @@ proc check_v3_target_little_endian { } {
}
proc check_v3_target_filesystem_ts { } {
+ global cxxflags
+ global DEFAULT_CXXFLAGS
global et_filesystem_ts
global tool
@@ -1930,7 +1932,11 @@ proc check_v3_target_filesystem_ts { } {
puts $f "#endif"
close $f
+ set cxxflags_saved $cxxflags
+ set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror -std=gnu++11"
+
set lines [v3_target_compile $src /dev/null preprocess ""]
+ set cxxflags $cxxflags_saved
file delete $src
if [string match "" $lines] {