Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85152 - trunk/libs/any/test
From: antoshkka_at_[hidden]
Date: 2013-07-24 11:33:51


Author: apolukhin
Date: 2013-07-24 11:33:51 EDT (Wed, 24 Jul 2013)
New Revision: 85152
URL: http://svn.boost.org/trac/boost/changeset/85152

Log:
Added some more C++11 tests for Boost.Any (refs #6999)

Added:
   trunk/libs/any/test/any_test_cv_to_rv_failed.cpp (contents, props changed)
   trunk/libs/any/test/any_test_temporary_to_rv_failed.cpp (contents, props changed)
Text files modified:
   trunk/libs/any/test/Jamfile.v2 | 2 ++
   trunk/libs/any/test/any_test_cv_to_rv_failed.cpp | 39 +++++++++++++++++++++++++++++++++++++++
   trunk/libs/any/test/any_test_temporary_to_rv_failed.cpp | 38 ++++++++++++++++++++++++++++++++++++++
   3 files changed, 79 insertions(+), 0 deletions(-)

Modified: trunk/libs/any/test/Jamfile.v2
==============================================================================
--- trunk/libs/any/test/Jamfile.v2 Wed Jul 24 11:01:41 2013 (r85151)
+++ trunk/libs/any/test/Jamfile.v2 2013-07-24 11:33:51 EDT (Wed, 24 Jul 2013) (r85152)
@@ -10,6 +10,8 @@
     [ run ../any_test.cpp ]
     [ run any_test_rv.cpp ]
     [ compile-fail any_cast_cv_failed.cpp ]
+ [ compile-fail any_test_temporary_to_rv_failed.cpp ]
+ [ compile-fail any_test_cv_to_rv_failed.cpp ]
     ;
 
 

Added: trunk/libs/any/test/any_test_cv_to_rv_failed.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/libs/any/test/any_test_cv_to_rv_failed.cpp 2013-07-24 11:33:51 EDT (Wed, 24 Jul 2013) (r85152)
@@ -0,0 +1,39 @@
+// Unit test for boost::any.
+//
+// See http://www.boost.org for most recent version, including documentation.
+//
+// Copyright Antony Polukhin, 2013.
+//
+// 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 <cstdlib>
+#include <string>
+#include <utility>
+
+#include "boost/any.hpp"
+#include "../test.hpp"
+#include <boost/move/move.hpp>
+
+#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+int main()
+{
+ BOOST_STATIC_ASSERT(false);
+ return EXIT_SUCCESS;
+}
+
+#else
+
+
+int main()
+{
+ boost::any const cvalue(10);
+ int i = boost::any_cast<int&&>(cvalue);
+ (void)i;
+ return EXIT_SUCCESS;
+}
+
+#endif
+

Added: trunk/libs/any/test/any_test_temporary_to_rv_failed.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/libs/any/test/any_test_temporary_to_rv_failed.cpp 2013-07-24 11:33:51 EDT (Wed, 24 Jul 2013) (r85152)
@@ -0,0 +1,38 @@
+// Unit test for boost::any.
+//
+// See http://www.boost.org for most recent version, including documentation.
+//
+// Copyright Antony Polukhin, 2013.
+//
+// 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 <cstdlib>
+#include <string>
+#include <utility>
+
+#include "boost/any.hpp"
+#include "../test.hpp"
+#include <boost/move/move.hpp>
+
+#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+int main()
+{
+ BOOST_STATIC_ASSERT(false);
+ return EXIT_SUCCESS;
+}
+
+#else
+
+
+int main()
+{
+ int i = boost::any_cast<int&>(10);
+ (void)i;
+ return EXIT_SUCCESS;
+}
+
+#endif
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk