2
0
mirror of https://github.com/boostorg/phoenix.git synced 2026-02-19 02:32:09 +00:00

Merge branch 'release-3.0.1'

This commit is contained in:
John Fletcher
2014-01-26 09:44:16 +00:00
35 changed files with 322 additions and 182 deletions

48
ChangeLog Normal file
View File

@@ -0,0 +1,48 @@
Boost Phoenix: A Standard compliant C++ preprocessor library
http://www.boost.org/
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010-2013 Thomas Heller
Copyright (c) 2014 John Fletcher
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)
-------------------------------------------------------------------------------
TODO (known issues):
- Create a full list of known issues.
- Inspection report outstanding issues
Fix copyright and licence in preprocessed files for function_equal
Fix libs/phoenix/doc/html/boostbook.css: Unlinked File
- Investigate fixes needed for the following bugs
(all refer to phoenix though not all may be in fact phoenix bugs)
#9295, #9291, #9260, #8820, #8800, #8774, #8704
#8564, #8558, #8504, #8298, #8187, #8156, #7996
#7953, #7946, #7730, #7633, #7481, #7480, #7423
#7391, #7356, #7166, #7165, #6911, #6848, #6665
#6202, #6133, #6026, #5875, #5824, #5715, #5687
- Complete work on the following under investigation
#9363, #9362, #7624, #7199
- #9113 warnings on -Wshadow - find and fix remaining warnings
-------------------------------------------------------------------------------
CHANGELOG
- V3.0.1
- Started CHANGELOG
- Fixed bug_000008 to use phoenix headers correctly.
This fixes it for most systems but not for
Clang Linux C++11 with libstdc++ where the problem seems
to be in boost/thread. Clang Linux C++11 with libc++ works.
- Fixed #9113 warnings on -Wshadow (some fixed)
- Fixed #9111 unused parameter warning in phoenix bind
- Fixed #8417 Minor documentation
- Fixed #7181 MSVC warnings
- Fixed #6268 phoenix and fusion operator < and added test bug6268
- Fixed many issues from Inspection report
phoenix/core/detail/phx_result.hpp Fixed clash with Apple macro 'check'
Boost V1.55:
- V3.0.0

View File

@@ -1,7 +1,7 @@
/*=============================================================================
Copyright (c) 2011 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
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)
==============================================================================*/

View File

@@ -1,3 +1,9 @@
/*=============================================================================
Copyright (c) 2011 Thomas Heller
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/phoenix.hpp>
#include <boost/typeof/typeof.hpp>
@@ -7,26 +13,26 @@
int main()
{
using boost::phoenix::lambda;
using boost::phoenix::let;
using boost::phoenix::ref;
using boost::phoenix::construct;
using boost::phoenix::local_names::_a;
using boost::phoenix::arg_names::_1;
using boost::phoenix::lambda;
using boost::phoenix::let;
using boost::phoenix::ref;
using boost::phoenix::construct;
using boost::phoenix::local_names::_a;
using boost::phoenix::arg_names::_1;
BOOST_AUTO(
generator
, (lambda
(
_a = val(_1)
)
[
std::cout << _a << " "
, _a++
])
);
BOOST_AUTO(
generator
, (lambda
(
_a = val(_1)
)
[
std::cout << _a << " "
, _a++
] )
);
int i = 0;
std::vector<int> v(10);
std::for_each(v.begin(), v.end(), generator(0));
int i = 0;
std::vector<int> v(10);
std::for_each(v.begin(), v.end(), generator(0));
}

View File

@@ -1,3 +1,9 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
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/phoenix.hpp>

View File

@@ -1,3 +1,9 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
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/phoenix.hpp>

View File

@@ -38,7 +38,7 @@ namespace boost { namespace phoenix { namespace detail
}
template <int M, typename RhsRT, typename RhsFP>
bool operator==(function_ptr<M, RhsRT, RhsFP> const & rhs) const
bool operator==(function_ptr<M, RhsRT, RhsFP> const & /*rhs*/) const
{
return false;
}

View File

@@ -29,6 +29,8 @@
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4522) // 'this' used in base member initializer list
#pragma warning(disable: 4510) // default constructor could not be generated
#pragma warning(disable: 4610) // can never be instantiated - user defined constructor required
#endif
namespace boost { namespace phoenix

View File

@@ -23,13 +23,13 @@ namespace boost { namespace phoenix {
typedef char (&no)[2];
template <typename A>
static yes check(typename A::type *);
static yes check_(typename A::type *);
template <typename A>
static no check(...);
static no check_(...);
static bool const value = (sizeof(yes) == sizeof(check<Result>(0)));
static bool const value = (sizeof(yes) == sizeof(check_<Result>(0)));
typedef boost::mpl::bool_<value> type;
};

View File

@@ -56,11 +56,11 @@ namespace boost { namespace phoenix
template <typename This, typename Actor, typename Context>
struct result<This(Actor, Context)>
: boost::remove_const<
typename boost::remove_reference<
typename boost::remove_reference<
typename evaluator::impl<Actor, Context, proto::empty_env>::result_type
>::type
>
{};
>::type
>
{};
template <typename Context>
typename result<custom_terminal(actor<Expr> const &, Context &)>::type

View File

@@ -22,7 +22,7 @@ namespace boost { namespace phoenix
struct visit_each_impl
{
Visitor& visitor;
visit_each_impl(Visitor& visitor ) : visitor(visitor) {}
visit_each_impl(Visitor& visitor_ ) : visitor(visitor_) {}
template <typename T>
void operator()(T const& t) const

View File

@@ -37,8 +37,8 @@ namespace boost { namespace phoenix
: f()
{}
BOOST_CONSTEXPR function(F f)
: f(f)
BOOST_CONSTEXPR function(F f_)
: f(f_)
{}
template <typename Sig>

View File

@@ -11,6 +11,7 @@
#include <boost/phoenix/operator/detail/define_operator.hpp>
#include <boost/phoenix/core/expression.hpp>
#include <boost/proto/operators.hpp>
#include <boost/proto/fusion.hpp> // Added to solve bug 6268
namespace boost { namespace phoenix
{

View File

@@ -96,22 +96,22 @@ namespace boost { namespace phoenix
>::type
env_type;
typedef
typename result_of::eval<
Lambda
, typename result_of::context<
scoped_environment<
env_type
, outer_env_type
, locals_type
, map_type
>
, typename result_of::actions<
Context
>::type
>::type
>::type
type;
typedef
typename result_of::eval<
Lambda
, typename result_of::context<
scoped_environment<
env_type
, outer_env_type
, locals_type
, map_type
>
, typename result_of::actions<
Context
>::type
>::type
>::type
type;
};
template <typename OuterEnv, typename Locals, typename Map, typename Lambda, typename Context>
@@ -148,7 +148,7 @@ namespace boost { namespace phoenix
>::type
env_type;
scoped_environment<
scoped_environment<
env_type
, outer_env_type
, locals_type

View File

@@ -44,11 +44,11 @@ namespace boost { namespace phoenix
, locals(locals)
{}
scoped_environment(scoped_environment const & o)
: env(o.env)
scoped_environment(scoped_environment const & o)
: env(o.env)
, outer_env(o.outer_env)
, locals(o.locals)
{};
, locals(o.locals)
{};
Env const & env;
OuterEnv const & outer_env;

View File

@@ -62,56 +62,56 @@ namespace boost { namespace phoenix {
template <typename This, typename A0, typename Context>
struct result<This(A0, Context)>
{
typedef
typename proto::detail::uncvref<
typename result_of::env<
Context
>::type
>::type
outer_env_type;
typedef
typename remove_pointer<
typename remove_reference<
typename fusion::result_of::at_c<
outer_env_type
, 0
>::type
>::type
>::type
actor_type;
typedef
typename result_of::eval<
A0 const &
, Context const &
>::type
a0_type;
typedef
typename proto::detail::uncvref<
typename result_of::env<
Context
>::type
>::type
outer_env_type;
typedef
vector2<actor_type const *, a0_type>
inner_env_type;
typedef
typename remove_pointer<
typename remove_reference<
typename fusion::result_of::at_c<
outer_env_type
, 0
>::type
>::type
>::type
actor_type;
typedef
scoped_environment<
inner_env_type
, outer_env_type
, vector0<>
, detail::map_local_index_to_tuple<>
>
env_type;
typedef
typename result_of::eval<
actor_type const &
, typename result_of::context<
inner_env_type
, typename result_of::actions<
Context
>::type
>::type
>::type
type;
typedef
typename result_of::eval<
A0 const &
, Context const &
>::type
a0_type;
typedef
vector2<actor_type const *, a0_type>
inner_env_type;
typedef
scoped_environment<
inner_env_type
, outer_env_type
, vector0<>
, detail::map_local_index_to_tuple<>
>
env_type;
typedef
typename result_of::eval<
actor_type const &
, typename result_of::context<
inner_env_type
, typename result_of::actions<
Context
>::type
>::type
>::type
type;
};
template <typename A0, typename Context>
@@ -121,50 +121,50 @@ namespace boost { namespace phoenix {
//std::cout << typeid(checker).name() << "\n";
//std::cout << typeid(checker).name() << "\n";
typedef
typename proto::detail::uncvref<
typename result_of::env<
Context
>::type
>::type
outer_env_type;
typedef
typename remove_pointer<
typename remove_reference<
typename fusion::result_of::at_c<
outer_env_type
, 0
>::type
>::type
>::type
actor_type;
typedef
typename result_of::eval<
A0 const &
, Context const &
>::type
a0_type;
typedef
typename proto::detail::uncvref<
typename result_of::env<
Context
>::type
>::type
outer_env_type;
typedef
vector2<actor_type const *, a0_type>
inner_env_type;
typedef
typename remove_pointer<
typename remove_reference<
typename fusion::result_of::at_c<
outer_env_type
, 0
>::type
>::type
>::type
actor_type;
typedef
scoped_environment<
inner_env_type
, outer_env_type
, vector0<>
, detail::map_local_index_to_tuple<>
>
env_type;
typedef
typename result_of::eval<
A0 const &
, Context const &
>::type
a0_type;
inner_env_type inner_env = {fusion::at_c<0>(phoenix::env(ctx)), phoenix::eval(a0, ctx)};
vector0<> locals;
env_type env(inner_env, phoenix::env(ctx), locals);
typedef
vector2<actor_type const *, a0_type>
inner_env_type;
return phoenix::eval(*fusion::at_c<0>(phoenix::env(ctx)), phoenix::context(inner_env, phoenix::actions(ctx)));
typedef
scoped_environment<
inner_env_type
, outer_env_type
, vector0<>
, detail::map_local_index_to_tuple<>
>
env_type;
inner_env_type inner_env = {fusion::at_c<0>(phoenix::env(ctx)), phoenix::eval(a0, ctx)};
vector0<> locals;
env_type env(inner_env, phoenix::env(ctx), locals);
return phoenix::eval(*fusion::at_c<0>(phoenix::env(ctx)), phoenix::context(inner_env, phoenix::actions(ctx)));
//return (*fusion::at_c<0>(phoenix::env(ctx)))(eval(a0, ctx));
}
};
@@ -174,17 +174,17 @@ namespace boost { namespace phoenix {
: call<this_eval>
{};
template <typename Dummy>
template <typename Dummy>
struct is_nullary::when<rule::this_, Dummy>
: proto::make<mpl::false_()>
{};
template <typename A0>
typename expression::this_<A0>::type const
this_(A0 const & a0)
{
return expression::this_<A0>::make(a0);
}
template <typename A0>
typename expression::this_<A0>::type const
this_(A0 const & a0)
{
return expression::this_<A0>::make(a0);
}
}}

View File

@@ -43,8 +43,8 @@ namespace boost { namespace phoenix
template <typename Do>
struct do_while_gen
{
do_while_gen(Do const& do_)
: do_(do_) {}
do_while_gen(Do const& do_it)
: do_(do_it) {}
template <typename Cond>
typename expression::do_while<Cond, Do>::type const

View File

@@ -56,17 +56,17 @@ namespace boost { namespace phoenix
template <typename Init, typename Cond, typename Step>
struct for_gen
{
for_gen(Init const& init, Cond const& cond, Step const& step)
: init(init), cond(cond), step(step) {}
for_gen(Init const& init_, Cond const& cond_, Step const& step_)
: init(init_), cond(cond_), step(step_) {}
template <typename Do>
typename expression::for_<Init, Cond, Step, Do>::type const
operator[](Do const& do_) const
operator[](Do const& do_it) const
{
return
expression::
for_<Init, Cond, Step, Do>::
make(init, cond, step, do_);
make(init, cond, step, do_it);
}
Init init;

View File

@@ -93,9 +93,9 @@ namespace boost { namespace phoenix
template<typename Cond, typename Then>
struct else_gen
{
else_gen(Cond const & cond, Then const & then)
: cond(cond)
, then(then) {}
else_gen(Cond const & cond_, Then const & then_)
: cond(cond_)
, then(then_) {}
template<typename Else>
typename expression::if_else_statement<Cond, Then, Else>::type const
@@ -135,8 +135,8 @@ namespace boost { namespace phoenix
template<typename Cond>
struct if_gen
{
if_gen(Cond const & cond)
: cond(cond) {}
if_gen(Cond const & cond_)
: cond(cond_) {}
template<typename Then>
typename expression::if_<Cond, Then>::type const

View File

@@ -238,7 +238,7 @@ namespace boost { namespace phoenix {
template <typename Cond>
struct switch_gen
{
switch_gen(Cond const& cond) : cond(cond) {}
switch_gen(Cond const& cond_) : cond(cond_) {}
template <typename Cases>
typename expression::switch_<

View File

@@ -274,7 +274,7 @@ namespace boost { namespace phoenix
template <typename TryCatch, typename Exception>
struct catch_gen
{
catch_gen(TryCatch const& try_catch) : try_catch(try_catch) {}
catch_gen(TryCatch const& try_catch_) : try_catch(try_catch_) {}
template <typename Expr>
typename boost::disable_if<
@@ -301,7 +301,7 @@ namespace boost { namespace phoenix
template <typename TryCatch>
struct catch_all_gen
{
catch_all_gen(TryCatch const& try_catch) : try_catch(try_catch) {}
catch_all_gen(TryCatch const& try_catch_) : try_catch(try_catch_) {}
template <typename Expr>
typename boost::disable_if<

View File

@@ -1,3 +1,9 @@
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable: 4512) // assignment operator could not be generated
#pragma warning(disable: 4510) // default constructor could not be generated
#pragma warning(disable: 4610) // can never be instantiated - user defined constructor required
#endif
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
#ifndef BOOST_PHOENIX_SUPPORT_VECTOR_HPP
@@ -132,3 +138,7 @@ BOOST_FUSION_ADAPT_TPL_STRUCT_NO_PARTIAL(
#endif
#endif
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

View File

@@ -13,6 +13,6 @@
// This is the version of the library
//
///////////////////////////////////////////////////////////////////////////////
#define BOOST_PHOENIX_VERSION 0x3000 // 3.0.0
#define BOOST_PHOENIX_VERSION 0x3001 // 3.0.1
#endif

View File

@@ -126,6 +126,7 @@ test-suite phoenix_regression :
[ run regression/bug5626.cpp ]
[ run regression/bug5968.cpp ]
[ run regression/bug6040.cpp ]
[ run regression/bug6268.cpp ]
;
test-suite phoenix_include :
@@ -139,6 +140,8 @@ test-suite phoenix_include :
[ run include/statement.cpp ]
[ run include/stl.cpp ]
[ run include/version.cpp ]
[ run include/bind/bind_member_function.cpp ]
[ run include/bind/bind_member_variable.cpp ]
[ run include/core/actor.cpp ]
[ run include/core/argument.cpp ]
[ run include/core/arity.cpp ]
@@ -148,13 +151,13 @@ test-suite phoenix_include :
[ run include/core/function_equal.cpp ]
[ run include/core/is_actor.cpp ]
[ run include/core/is_nullary.cpp ]
[ run include/core/nothing.cpp ]
[ run include/core/meta_grammar.cpp ]
[ run include/core/limits.cpp ]
[ run include/core/meta_grammar.cpp ]
[ run include/core/nothing.cpp ]
[ run include/core/reference.cpp ]
[ run include/core/terminal.cpp ]
[ run include/core/value.cpp ]
[ run include/core/visit_each.cpp ]
[ run include/core/reference.cpp ]
[ run include/function/function.cpp : : : : function_function ]
[ run include/fusion/at.cpp ]
[ run include/object/const_cast.cpp ]

View File

@@ -1,3 +1,9 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
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/phoenix/bind/bind_function.hpp>
#include <boost/phoenix/core/argument.hpp>

View File

@@ -1,3 +1,10 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
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/range.hpp>
#include <boost/range/irange.hpp>

View File

@@ -1,3 +1,10 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
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/phoenix.hpp>
#include <boost/signals2.hpp>

View File

@@ -1,3 +1,11 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
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/phoenix.hpp>
#include <vector>
#include <algorithm>

View File

@@ -0,0 +1,20 @@
#include <boost/fusion/sequence/comparison.hpp>
#include <boost/fusion/sequence/sequence_facade.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator/comparison.hpp>
struct foo : boost::fusion::sequence_facade<foo, boost::fusion::random_access_traversal_tag>
{
// Rest of the sequence_facade extension mechanism code omitted,
// as it is not needed to reproduce the error
foo() : x(), y() {}
int x;
int y;
};
int main()
{
/*auto x = */ boost::phoenix::arg_names::arg1 < foo();
}

View File

@@ -11,11 +11,13 @@
// for a description of the bug being tested for by this program
//
// This code is borrowed from Spirit's bug_000008.cpp test for multithreads.
// Now modified to point to the Phoenix headers
// instead of the ones in Spirit.
#include <iostream>
#include <boost/config.hpp>
#include <boost/assert.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/spirit/home/phoenix/scope/dynamic.hpp>
#include <boost/phoenix/scope/dynamic.hpp>
#if defined(DONT_HAVE_BOOST) \
|| !defined(BOOST_HAS_THREADS) \
@@ -42,15 +44,16 @@ main()
#else
// the real MT stuff
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_scope.hpp>
#include <boost/phoenix/operator.hpp>
#include <boost/phoenix/scope.hpp>
#include <boost/thread.hpp>
static const int number_of_calls_per_thread=20000;
struct test_dynamic : boost::phoenix::dynamic<int>
{
test_dynamic() : b(*this) {}
// test_dynamic() : b(*this) {}
test_dynamic() : b(init<0>(this)) {}
member1 b;
};

View File

@@ -184,16 +184,16 @@ main()
}
{
{
{
// $$$ Fixme. This should not be failing $$$
//int x = (let(_a = lambda[val(1)])[_a])()();
//BOOST_TEST(x == 1);
}
}
{
{
int x = (let(_a = lambda[val(1)])[bind(_a)])();
BOOST_TEST(x == 1);
}
}
}
{

View File

@@ -59,20 +59,20 @@ int main()
std::cout << _1 << " "
, this_(_1 - 1)
]
, val(0)
, val(0)
));
/*
f((
if_else(
/*
f((
if_else(
_1 == 0
, _1
,this_(_1 - 1)
)
));
*/
f((
*/
f((
if_else(
_1 != 0
,this_(_1 - 1)
@@ -120,5 +120,5 @@ int main()
)
)
));
*/
*/
}

View File

@@ -1,3 +1,10 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
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 <cmath>
#include <boost/function.hpp>
#include <boost/phoenix/core.hpp>