diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-12-21 04:09:01 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-12-21 04:09:01 +0000 |
commit | 49b183a9ecf62bc1b37e53bdddf42e6ea4ce4cd7 (patch) | |
tree | 62926809ce6b5b1d56cf4ebd6a1492d6f590f1fc /libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp | |
parent | 866885e12a2278a77dcb195872730d8b0498e43e (diff) | |
download | bcm5719-llvm-49b183a9ecf62bc1b37e53bdddf42e6ea4ce4cd7.tar.gz bcm5719-llvm-49b183a9ecf62bc1b37e53bdddf42e6ea4ce4cd7.zip |
Implement LWG 3065: Make path operators friends.
This prevents things like:
using namespace std::filesystem;
auto x = L"a/b" == std::string("a/b");
llvm-svn: 349884
Diffstat (limited to 'libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp')
-rw-r--r-- | libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp new file mode 100644 index 00000000000..e0b3a959c29 --- /dev/null +++ b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/append_op.fail.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// 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 + +// <filesystem> + +#include "filesystem_include.hpp" + +using namespace fs; + +struct ConvToPath { + operator fs::path() const { + return ""; + } +}; + +int main() { + ConvToPath LHS, RHS; + (void)(LHS / RHS); // expected-error {{invalid operands to binary expression}} +}
\ No newline at end of file |