[libcxx-commits] [libcxx] 1700ea7 - [libc++] Remove the ability to use braced-init for filesystem paths

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 4 08:49:29 PST 2021


Author: Louis Dionne
Date: 2021-02-04T11:49:00-05:00
New Revision: 1700ea7302870b38df2cd048d9920368dc87453b

URL: https://github.com/llvm/llvm-project/commit/1700ea7302870b38df2cd048d9920368dc87453b
DIFF: https://github.com/llvm/llvm-project/commit/1700ea7302870b38df2cd048d9920368dc87453b.diff

LOG: [libc++] Remove the ability to use braced-init for filesystem paths

According to my reading of http://eel.is/c++draft/filesystems#fs.class.path,
the Standard doesn't actually mention that this should work. Since other
implementations don't allow it, allowing it in libc++ is just setting a
portability trap.

Supersedes https://reviews.llvm.org/D89865.

Differential Revision: https://reviews.llvm.org/D95975

Added: 
    

Modified: 
    libcxx/include/filesystem

Removed: 
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp


################################################################################
diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index b11de541b0fe..8d0b0f51cb4b 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -973,8 +973,8 @@ public:
     return *this;
   }
 
-  template <class = void>
-  _LIBCPP_INLINE_VISIBILITY path& operator=(string_type&& __s) noexcept {
+  _LIBCPP_INLINE_VISIBILITY
+  path& operator=(string_type&& __s) noexcept {
     __pn_ = _VSTD::move(__s);
     return *this;
   }

diff  --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp
deleted file mode 100644
index 55c0d7a17244..000000000000
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.assign/braced_init.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-
-// <filesystem>
-
-// class path
-
-// path& operator=(path const&);
-
-#include "filesystem_include.h"
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "count_new.h"
-
-
-int main(int, char**) {
-  using namespace fs;
-  path p("abc");
-  p = {};
-#ifdef _WIN32
-  assert(p.native() == L"");
-#else
-  assert(p.native() == "");
-#endif
-
-  return 0;
-}


        


More information about the libcxx-commits mailing list