[libcxx] r284310 - Implement LWG2664 and update its status
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 15 14:29:45 PDT 2016
Author: ericwf
Date: Sat Oct 15 16:29:44 2016
New Revision: 284310
URL: http://llvm.org/viewvc/llvm-project?rev=284310&view=rev
Log:
Implement LWG2664 and update its status
Added:
libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/
libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
Modified:
libcxx/trunk/include/experimental/filesystem
libcxx/trunk/www/upcoming_meeting.html
Modified: libcxx/trunk/include/experimental/filesystem
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=284310&r1=284309&r2=284310&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/filesystem (original)
+++ libcxx/trunk/include/experimental/filesystem Sat Oct 15 16:29:44 2016
@@ -759,6 +759,8 @@ private:
public:
// appends
path& operator/=(const path& __p) {
+ _LIBCPP_ASSERT(!__p.has_root_name(),
+ "cannot append to a path with a root name");
__append_sep_if_needed(__p.empty() ? char{} : __p.__pn_[0]);
__pn_ += __p.native();
return *this;
Added: libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp?rev=284310&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp (added)
+++ libcxx/trunk/test/libcxx/experimental/filesystem/class.path/path.member/path.append.pass.cpp Sat Oct 15 16:29:44 2016
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <experimental/filesystem>
+
+// class path
+
+// path& operator/=(path const&)
+// path operator/(path const&, path const&)
+
+
+#define _LIBCPP_DEBUG 0
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (void)::AssertCount++)
+int AssertCount = 0;
+
+#include <experimental/filesystem>
+#include <type_traits>
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+#include "test_iterators.h"
+#include "count_new.hpp"
+#include "filesystem_test_helper.hpp"
+
+namespace fs = std::experimental::filesystem;
+
+int main()
+{
+ using namespace fs;
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("/bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 0);
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ lhs /= rhs;
+ assert(AssertCount == 1);
+ AssertCount = 0;
+ }
+ {
+ path lhs("//foo");
+ path rhs("//bar");
+ assert(AssertCount == 0);
+ (void)(lhs / rhs);
+ assert(AssertCount == 1);
+ }
+ // FIXME The same error is not diagnosed for the append(Source) and
+ // append(It, It) overloads.
+}
Modified: libcxx/trunk/www/upcoming_meeting.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/upcoming_meeting.html?rev=284310&r1=284309&r2=284310&view=diff
==============================================================================
--- libcxx/trunk/www/upcoming_meeting.html (original)
+++ libcxx/trunk/www/upcoming_meeting.html Sat Oct 15 16:29:44 2016
@@ -88,7 +88,7 @@
<tr><td><a href="http://wg21.link/LWG2589">2589</a></td><td>match_results can't satisfy the requirements of a container</td><td>Issaquah</td><td>Nothing to do</td></tr>
<tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2598">2598</a></td><td>addressof works on temporaries</td><td>Issaquah</td><td>Patch ready</td></tr>
- <tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td></td></tr>
+ <tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td>Nothing to do</td></tr>
<tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Issaquah</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2672">2672</a></td><td>Should is_empty use error_code in its specification?</td><td>Issaquah</td><td></td></tr>
<tr><td><a href="http://wg21.link/LWG2678">2678</a></td><td>std::filesystem enum classes overspecified</td><td>Issaquah</td><td>Nothing to do</td></tr>
@@ -166,7 +166,7 @@
<li>2589 - This is just wording cleanup. </li>
<li>2591 - I <b>suspect</b> that this is just better specification of the existing structure. Probably need more tests for this.</li>
<li>2598 - Patch and tests ready</li>
-<li>2664 - File System; Eric?</li>
+<li>2664 - No change needed. _LIBCPP_DEBUG mode tests the new requirements.</li>
<li>2665 - File System; Eric?</li>
<li>2672 - File System; Eric?</li>
<li>2678 - File System; Eric?</li>
More information about the cfe-commits
mailing list