From a98bcc0f5dcf09012a807188db2ac8c906bf44e6 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Mon, 3 Feb 2014 23:56:25 +0000 Subject: [PATCH 1/5] include/boost/phoenix/core/is_nullary.hpp #7730 --- include/boost/phoenix/core/is_nullary.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/phoenix/core/is_nullary.hpp b/include/boost/phoenix/core/is_nullary.hpp index 509c4d2..f90a043 100644 --- a/include/boost/phoenix/core/is_nullary.hpp +++ b/include/boost/phoenix/core/is_nullary.hpp @@ -137,12 +137,20 @@ namespace boost { namespace phoenix struct is_nullary : is_nullary {}; - + +#ifdef BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL + template + struct is_nullary, + typename custom_terminal::_is_default_custom_terminal > + : mpl::true_ + {}; +#else template struct is_nullary > : mpl::true_ {}; - +#endif + template struct is_nullary > > : evaluator From 9293d138a3711628595c56b2974b42c36f2ff295 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Mon, 3 Feb 2014 23:57:17 +0000 Subject: [PATCH 2/5] include/boost/phoenix/core/terminal.hpp #7730 --- include/boost/phoenix/core/terminal.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/phoenix/core/terminal.hpp b/include/boost/phoenix/core/terminal.hpp index 79ebe64..726694f 100644 --- a/include/boost/phoenix/core/terminal.hpp +++ b/include/boost/phoenix/core/terminal.hpp @@ -48,7 +48,13 @@ namespace boost { namespace phoenix : mpl::false_ {}; template - struct custom_terminal; + struct custom_terminal +#ifdef BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL + { + typedef void _is_default_custom_terminal; // suggested fix for #7730 + } +#endif + ; namespace expression { From 56775d06b51e349d02c72acf3dfe89c94d7e590c Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Mon, 3 Feb 2014 23:57:43 +0000 Subject: [PATCH 3/5] test/include/core/bug7730.cpp new test --- test/include/core/bug7730.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/include/core/bug7730.cpp diff --git a/test/include/core/bug7730.cpp b/test/include/core/bug7730.cpp new file mode 100644 index 0000000..7df697c --- /dev/null +++ b/test/include/core/bug7730.cpp @@ -0,0 +1,8 @@ +/*============================================================================= + 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) +==============================================================================*/ +#define BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL +#include +int main() {} From c073ca45338e30e54c80d9b996208e98d06094d1 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Mon, 3 Feb 2014 23:58:52 +0000 Subject: [PATCH 4/5] test/Jamfile Add test bug7730 --- test/Jamfile | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Jamfile b/test/Jamfile index 5a3b525..5e59719 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -166,6 +166,7 @@ test-suite phoenix_include : [ run include/core/nothing.cpp ] [ run include/core/reference.cpp ] [ run include/core/terminal.cpp ] + [ run include/core/bug7730.cpp ] [ run include/core/value.cpp ] [ run include/core/visit_each.cpp ] [ run include/function/function.cpp : : : : function_function ] From a3c2761e84f215e82415321f4e253e676af8a0ca Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Tue, 4 Feb 2014 00:02:12 +0000 Subject: [PATCH 5/5] ChangeLog Entry for #7730 --- ChangeLog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e56ad90..079e7c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,7 +26,7 @@ TODO (known issues): (all refer to phoenix though not all may be in fact phoenix bugs #9291, #9260, #8820, #8800 #8564, #8558, #8504, #8298, #8187, #8156, #7996 -#7953, #7946, #7730, #7481, #7480, #7423 +#7953, #7946, #7481, #7480, #7423 #7391, #7356, #6911, #6848, #6202, #6133, #6026, #5687 - Feature requests @@ -49,6 +49,9 @@ CHANGELOG - Fixed #8704 Using Phoenix lambdas on top of custom Proto expressions This works for C++11 only. Test cmath applies to this. +- Fixed #7730 Generic specializations of is_nullary for custom terminals are not possible + Define BOOST_PHOENIX_SPECIALIZE_CUSTOM_TERMINAL to use this. + Test bug7730 tests this. - Fixed #7624 Deduction failure This works for C++11 and has a workaround for C++03 Test bug7624 tests both versions.