1/*=============================================================================
2 Copyright (c) 2005-2007 Dan Marsden
3 Copyright (c) 2005-2007 Joel de Guzman
4 Copyright (c) 2014 John Fletcher
5
6 Distributed under the Boost Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8==============================================================================*/
9
10#include <boost/phoenix.hpp>
11#include <boost/range/as_literal.hpp>
12#include <boost/core/lightweight_test.hpp>
13
14using namespace boost::phoenix::placeholders;
15using namespace boost::phoenix;
16
17int main()
18{
19 char X('x');
20 find(a0: boost::as_literal(arr: "fox"), a1: 'x')(); // works
21#if !(defined (BOOST_NO_CXX11_DECLTYPE) || \
22 defined (BOOST_INTEL_CXX_VERSION) || \
23 (BOOST_GCC_VERSION < 40500) )
24 const char *Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11
25#else
26 const char *Y = find(a0: boost::as_literal(arr: "fox"), a1: construct<char>(a0: arg1))('x'); // works
27#endif
28 BOOST_TEST(X == *Y);
29
30 return boost::report_errors();
31}
32

source code of boost/libs/phoenix/test/regression/bug7624.cpp