Boost C++ Libraries: Ticket #13007: When BOOST_BIND_NO_PLACEHOLDERS is defined, framework.ipp seems to be missing an #include https://svn.boost.org/trac10/ticket/13007 <p> Like the summary says, I think boost/test/impl/framework.ipp should simply have one additional #include &lt;boost/bind/placeholders.hpp&gt; so it works when BOOST_BIND_NO_PLACEHOLDERS is defined. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13007 Trac 1.4.3 Raffi Enficiaud Tue, 06 Jun 2017 14:19:34 GMT owner, status changed https://svn.boost.org/trac10/ticket/13007#comment:1 https://svn.boost.org/trac10/ticket/13007#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Raffi Enficiaud Tue, 06 Jun 2017 14:19:46 GMT milestone changed https://svn.boost.org/trac10/ticket/13007#comment:2 https://svn.boost.org/trac10/ticket/13007#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.65.0</span> </li> </ul> Ticket Raffi Enficiaud Fri, 23 Jun 2017 16:09:54 GMT <link>https://svn.boost.org/trac10/ticket/13007#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13007#comment:3</guid> <description> <p> Sorry, I am not able to reproduce the error: </p> <pre class="wiki">#define BOOST_BIND_NO_PLACEHOLDERS #define BOOST_TEST_MODULE bind_no_placeholder #include &lt;boost/test/unit_test.hpp&gt; BOOST_AUTO_TEST_CASE(test1) { int i = 1; BOOST_TEST(1 == i); } </pre><p> works. Am I missing something? I am doing this on the current develop branch. </p> </description> <category>Ticket</category> </item> <item> <author>bspencer@…</author> <pubDate>Fri, 23 Jun 2017 16:50:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13007#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13007#comment:4</guid> <description> <p> Sorry for not being specific enough originally. </p> <p> I can reproduce it on boost-1.64.0 if I use the headers-only include in your test program. </p> <pre class="wiki">#include &lt;boost/test/included/unit_test.hpp </pre><p> It also happens if you define BOOST_BIND_NO_PLACEHOLDERS in boost/config/user.hpp and compile the standalone Boost.Test library. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Sat, 24 Jun 2017 19:23:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13007#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13007#comment:5</guid> <description> <p> Ok, thank you for the feedback. I am hesitating concerning the fix of forcing the include of the <code>placeholders.hpp</code> even if the macro is defined. OTOH, the fact that this is working in case of non-header-only variant is also not coherent. </p> <p> What is the use case of the <code>BOOST_BIND_NO_PLACEHOLDERS</code> for you? I still do not understand why you would like to use this non-documented macro and what is the benefit. When you define it, do you include <code>std::</code> placeholders instead? </p> </description> <category>Ticket</category> </item> <item> <author>bspencer@…</author> <pubDate>Fri, 07 Jul 2017 21:21:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13007#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13007#comment:6</guid> <description> <p> It seems that this only happens with some toolchains. For example, consider the following program, which works if <code>BOOST_BIND_NO_PLACEHOLDERS</code> is defined, but fails to compile otherwise (at least with some toolchains): </p> <pre class="wiki">//#define BOOST_BIND_NO_PLACEHOLDERS #include &lt;boost/bind.hpp&gt; #include &lt;functional&gt; #include &lt;cstdio&gt; using namespace std::placeholders; int main() { const auto g = std::bind(std::puts, _1); g("Hello, world!"); } </pre><p> With gcc-4.9 (admittedly old, but still important for some targets): </p> <pre class="wiki">$ g++ -Wall -std=c++11 -c -o foo.o foo.cc -I boost_1_64_0 foo.cc: In function ‘int main()’: foo.cc:10:39: error: reference to ‘_1’ is ambiguous const auto g = std::bind(std::puts, _1); ^ In file included from /usr/include/c++/4.9/memory:79:0, from boost_1_64_0/boost/config/no_tr1/memory.hpp:21, from boost_1_64_0/boost/get_pointer.hpp:14, from boost_1_64_0/boost/bind/mem_fn.hpp:25, from boost_1_64_0/boost/mem_fn.hpp:22, from boost_1_64_0/boost/bind/bind.hpp:26, from boost_1_64_0/boost/bind.hpp:22, from foo.cc:2: /usr/include/c++/4.9/functional:972:34: note: candidates are: const std::_Placeholder&lt;1&gt; std::placeholders::_1 extern const _Placeholder&lt;1&gt; _1; ^ In file included from boost_1_64_0/boost/bind/bind.hpp:2319:0, from boost_1_64_0/boost/bind.hpp:22, from foo.cc:2: boost_1_64_0/boost/bind/placeholders.hpp:46:38: note: constexpr const boost::arg&lt;1&gt; boost::placeholders::_1 BOOST_STATIC_CONSTEXPR boost::arg&lt;1&gt; _1; ^ </pre><p> Using an online version of gcc-7 at coliru.stacked-crocked.com, it fails in the same way. (I can't post a link or Trac calls this post spam). </p> <p> I don't see this with modern clang, but gcc-7 is pretty new, so there still seems to be a reason to set <code>BOOST_BIND_NO_PLACEHOLDERS</code>. </p> <p> BTW, I thought I remembered <code>BOOST_BIND_NO_PLACEHOLDERS</code> being documented in <code>config/user.hpp</code>, but it seems I was mistaken about that, at least in 1.64.0. </p> </description> <category>Ticket</category> </item> <item> <author>bspencer@…</author> <pubDate>Fri, 07 Jul 2017 21:22:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13007#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13007#comment:7</guid> <description> <p> I meant, of course, coliru.stacked-crooked.com </p> </description> <category>Ticket</category> </item> </channel> </rss>