Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67604 - in trunk: boost/variant boost/variant/detail libs/variant/test
From: steven_at_[hidden]
Date: 2011-01-02 23:57:46


Author: steven_watanabe
Date: 2011-01-02 23:57:44 EST (Sun, 02 Jan 2011)
New Revision: 67604
URL: http://svn.boost.org/trac/boost/changeset/67604

Log:
Avoid error instantiating map with recursive_variant_. Disable ADL to make instantiation less likely. Fixes #4584.
Text files modified:
   trunk/boost/variant/detail/visitation_impl.hpp | 4 ++--
   trunk/boost/variant/variant_fwd.hpp | 2 +-
   trunk/libs/variant/test/recursive_variant_test.cpp | 7 +++++++
   3 files changed, 10 insertions(+), 3 deletions(-)

Modified: trunk/boost/variant/detail/visitation_impl.hpp
==============================================================================
--- trunk/boost/variant/detail/visitation_impl.hpp (original)
+++ trunk/boost/variant/detail/visitation_impl.hpp 2011-01-02 23:57:44 EST (Sun, 02 Jan 2011)
@@ -167,7 +167,7 @@
         , has_nothrow_copy<T>
>::type never_uses_backup;
 
- return visitation_impl_invoke_impl(
+ return (visitation_impl_invoke_impl)(
           internal_which, visitor, storage, t
         , never_uses_backup()
         );
@@ -246,7 +246,7 @@
     // ...applying the appropriate case:
 # define BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE(z, N, _) \
     case (Which::value + (N)): \
- return visitation_impl_invoke( \
+ return (visitation_impl_invoke)( \
               internal_which, visitor, storage \
             , static_cast<BOOST_PP_CAT(T,N)*>(0) \
             , no_backup_flag, 1L \

Modified: trunk/boost/variant/variant_fwd.hpp
==============================================================================
--- trunk/boost/variant/variant_fwd.hpp (original)
+++ trunk/boost/variant/variant_fwd.hpp 2011-01-02 23:57:44 EST (Sun, 02 Jan 2011)
@@ -229,7 +229,7 @@
 // Tag type indicates where recursive variant substitution should occur.
 //
 #if !defined(BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT)
- struct recursive_variant_;
+ struct recursive_variant_ {};
 #else
     typedef mpl::arg<1> recursive_variant_;
 #endif

Modified: trunk/libs/variant/test/recursive_variant_test.cpp
==============================================================================
--- trunk/libs/variant/test/recursive_variant_test.cpp (original)
+++ trunk/libs/variant/test/recursive_variant_test.cpp 2011-01-02 23:57:44 EST (Sun, 02 Jan 2011)
@@ -18,6 +18,7 @@
 #include <iostream>
 #include <sstream>
 #include <vector>
+#include <map>
 
 struct vector_printer
     : boost::static_visitor<std::string>
@@ -124,6 +125,12 @@
 
     std::cout << "result5: " << result5 << '\n';
     BOOST_CHECK(result5 == "( 3.5 ( 3 5 ( 3 5 ) 7 ) 17.25 ) ");
+
+ typedef boost::make_recursive_variant<
+ int,
+ std::map<int, boost::recursive_variant_>
+ >::type var6_t;
+ var6_t var6;
 }
 
 void test_recursive_variant_over()


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