filesystem/test/cf_path_nullptr_test.cpp
Andrey Semashev f05ac885d1 Disabled construction and assignment of path from nullptr.
It is always an error and UB. Explicitly deleting the functions produces
better compiler errors.

Closes https://github.com/boostorg/filesystem/issues/278.
2023-02-04 20:24:18 +03:00

20 lines
432 B
C++

// Copyright 2023 Andrey Semashev.
//
// Distributed under the Boost Software License, Version 1.0.
//
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/filesystem/path.hpp>
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_NULLPTR)
#error "This test requires support for C++11 nullptr"
#endif
int main()
{
boost::filesystem::path p(nullptr);
p = nullptr;
}