diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f98ca08..f34efe4 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -22,6 +22,8 @@ run ref_test.cpp ; compile-fail ref_rv_fail1.cpp ; compile-fail ref_rv_fail2.cpp ; compile-fail ref_rv_fail3.cpp ; +compile-fail ref_implicit_fail.cpp ; +compile-fail ref_implicit_fail2.cpp ; run eif_constructors.cpp ; run eif_dummy_arg_disambiguation.cpp ; diff --git a/test/ref_implicit_fail.cpp b/test/ref_implicit_fail.cpp new file mode 100644 index 0000000..a012f52 --- /dev/null +++ b/test/ref_implicit_fail.cpp @@ -0,0 +1,20 @@ +// +// Rvalues should not implicitly convert to a reference_wrapper +// +// Copyright 2014 Peter Dimov +// +// 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 + +void f( boost::reference_wrapper< int > ) +{ +} + +int main() +{ + f( 1 ); // should fail +} diff --git a/test/ref_implicit_fail2.cpp b/test/ref_implicit_fail2.cpp new file mode 100644 index 0000000..ff67630 --- /dev/null +++ b/test/ref_implicit_fail2.cpp @@ -0,0 +1,20 @@ +// +// Rvalues should not implicitly convert to a reference_wrapper +// +// Copyright 2014 Peter Dimov +// +// 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 + +void f( boost::reference_wrapper< int const > ) +{ +} + +int main() +{ + f( 1 ); // should fail +}