brintos

brintos / llvm-project-archived public Read only

0
0
Text · 988 B · 404ad4c Raw
39 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++1410 11// <filesystem>12 13// class path14 15// path& operator=(path const&);16 17#include <filesystem>18#include <cassert>19#include <string>20#include <type_traits>21 22#include "test_macros.h"23namespace fs = std::filesystem;24 25int main(int, char**) {26  using namespace fs;27  static_assert(std::is_copy_assignable<path>::value, "");28  static_assert(!std::is_nothrow_copy_assignable<path>::value, "should not be noexcept");29  const std::string s("foo");30  const path p(s);31  path p2;32  path& pref = (p2 = p);33  assert(p.string() == s);34  assert(p2.string() == s);35  assert(&pref == &p2);36 37  return 0;38}39