From b75c8b9fba0a6dc22e12c1f25a19b657e4daa73f Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Thu, 23 Jan 2014 20:05:38 +0000 Subject: [PATCH 1/4] test/regression/bug7624.cpp New file --- test/regression/bug7624.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/regression/bug7624.cpp diff --git a/test/regression/bug7624.cpp b/test/regression/bug7624.cpp new file mode 100644 index 0000000..0516c6a --- /dev/null +++ b/test/regression/bug7624.cpp @@ -0,0 +1,12 @@ +#include +#include + +using namespace boost::phoenix::placeholders; +using namespace boost::phoenix; + +int main() +{ + find(boost::as_literal("fox"), 'x')(); // works + find(boost::as_literal("fox"), construct(arg1))('x'); // works + find(boost::as_literal("fox"), arg1)('x'); // compilation error +} From b86588f5085249c48f7c8bb5af2d2093ca32b557 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Thu, 23 Jan 2014 20:15:05 +0000 Subject: [PATCH 2/4] test/Jamfile add regression/bug7624.cpp --- test/Jamfile | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Jamfile b/test/Jamfile index 70f0bd7..e68ee14 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -126,6 +126,7 @@ test-suite phoenix_regression : [ run regression/bug5626.cpp ] [ run regression/bug5968.cpp ] [ run regression/bug6040.cpp ] + [ run regression/bug7624.cpp ] ; test-suite phoenix_include : From 9d224c7330b44431cbac620e1d89817a4a3b17b2 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Sun, 2 Feb 2014 11:21:15 +0000 Subject: [PATCH 3/4] test/regression/bug7624.cpp C++11 conditional solution --- test/regression/bug7624.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/regression/bug7624.cpp b/test/regression/bug7624.cpp index 0516c6a..48dc49e 100644 --- a/test/regression/bug7624.cpp +++ b/test/regression/bug7624.cpp @@ -1,12 +1,18 @@ #include #include +#include using namespace boost::phoenix::placeholders; using namespace boost::phoenix; int main() { - find(boost::as_literal("fox"), 'x')(); // works - find(boost::as_literal("fox"), construct(arg1))('x'); // works - find(boost::as_literal("fox"), arg1)('x'); // compilation error + char X('x'), Y ; + find(boost::as_literal("fox"), 'x')(); // works +#ifndef BOOST_NO_CXX11_DECLTYPE + Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11 +#else + Y = find(boost::as_literal("fox"), construct(arg1))('x'); // works +#endif + BOOST_TEST(X==Y); } From 6055449a9c5c8a42e3a629ddd36f6d5ad56bdd92 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Sun, 2 Feb 2014 11:31:25 +0000 Subject: [PATCH 4/4] test/regression/bug7624.cpp Revised version --- test/regression/bug7624.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/regression/bug7624.cpp b/test/regression/bug7624.cpp index 48dc49e..09191e2 100644 --- a/test/regression/bug7624.cpp +++ b/test/regression/bug7624.cpp @@ -7,12 +7,13 @@ using namespace boost::phoenix; int main() { - char X('x'), Y ; + char X('x'); find(boost::as_literal("fox"), 'x')(); // works #ifndef BOOST_NO_CXX11_DECLTYPE - Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11 + const char *Y = find(boost::as_literal("fox"), arg1)('x'); // works for C++11 #else - Y = find(boost::as_literal("fox"), construct(arg1))('x'); // works + const char *Y = find(boost::as_literal("fox"), construct(arg1))('x'); // works #endif - BOOST_TEST(X==Y); + BOOST_TEST(X == *Y); + }