Disable binding ref to temporaries when rvalue references are supported

This commit is contained in:
K-ballo
2014-06-09 19:50:22 -03:00
parent af629ffa59
commit 45f7564db2
5 changed files with 100 additions and 0 deletions

21
test/ref_rv_fail1.cpp Normal file
View File

@@ -0,0 +1,21 @@
// Copyright 2002-2004 David Abrahams and Aleksey Gurtovoy
// Copyright 2014 Agustin Berge
//
// 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/ref.hpp>
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
int main()
{
boost::reference_wrapper<int const> r(1); // this should produce an ERROR
return 0;
}
# else
# error To fail, this test requires rvalue references
# endif