bug5715.cpp 932 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*=============================================================================
  2. Copyright (c) 2005-2007 Dan Marsden
  3. Copyright (c) 2005-2007 Joel de Guzman
  4. Copyright (c) 2014 John Fletcher
  5. Distributed under the Boost Software License, Version 1.0. (See accompanying
  6. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  7. ==============================================================================*/
  8. // Check for Bug5715
  9. #include <boost/phoenix/statement/sequence.hpp>
  10. #include <boost/phoenix/bind.hpp>
  11. #include <boost/core/lightweight_test.hpp>
  12. namespace test
  13. {
  14. int x = 0;
  15. int y = 0;
  16. int z = 0;
  17. void f() { ++x; ++y; }
  18. void g() { --x; ++z; }
  19. }
  20. int main()
  21. {
  22. (
  23. boost::phoenix::bind(test::f),
  24. boost::phoenix::bind(test::g)
  25. )();
  26. BOOST_TEST(test::x == 0);
  27. BOOST_TEST(test::y == 1);
  28. BOOST_TEST(test::z == 1);
  29. return boost::report_errors();
  30. }