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-exception
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03, c++11, c++14
10// UNSUPPORTED: availability-filesystem-missing
11
12// <filesystem>
13
14// class path
15
16// path(path const&)
17
18#include <filesystem>
19#include <cassert>
20#include <string>
21#include <type_traits>
22
23#include "test_macros.h"
24namespace fs = std::filesystem;
25
26int main(int, char**) {
27 using namespace fs;
28 static_assert(std::is_copy_constructible<path>::value, "");
29 static_assert(!std::is_nothrow_copy_constructible<path>::value, "should not be noexcept");
30 const std::string s("foo");
31 const path p(s);
32 path p2(p);
33 assert(p.string() == s);
34 assert(p2.string() == s);
35
36 return 0;
37}
38

source code of libcxx/test/std/input.output/filesystems/class.path/path.member/path.construct/copy.pass.cpp