Boost C++ Libraries: Ticket #2961: Boost 1.38.0 fails to compile on g++-4.0.2 https://svn.boost.org/trac10/ticket/2961 <p> Boost 1.38.0 fails to compile on g++-4.0.2 on x86 Linux (while -4.0.1 is a tested target). The code compiles on g++-3.4.3. </p> <p> The offending file is source:/tags/release/Boost_1_38_0/boost/math/policies/policy.hpp . I'm sorry, that I don't have the full error message here, it's at work, and I don't have the specific compiler setup at home. </p> <pre class="wiki">namespace detail{ template &lt;class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11&gt; char test_is_policy(const policy&lt;A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11&gt;*); double test_is_policy(...); template &lt;class P&gt; struct is_policy_imp { BOOST_STATIC_CONSTANT(bool, value = (sizeof(test_is_policy(static_cast&lt;P*&gt;(0))) == 1)); }; } </pre><p> The error says that: <code> "test_is_policy" undefined at scope </code>, at line <code> BOOST_STATIC_CONSTANT(bool, value = (sizeof(test_is_policy(static_cast&lt;P*&gt;(0))) == 1)); </code> </p> <p> Solution: </p> <p> Replace <code> sizeof(test_is_policy(static_cast&lt;P*&gt;(0))) </code> with <code> sizeof(boost::math::policy::detail::test_is_policy(static_cast&lt;P*&gt;(0))) </code> </p> <p> Note: the same fix probably applies to source:/trunk/boost/math/policies/policy.hpp </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2961 Trac 1.4.3 Alex Shapiro <alexsh@…> Sun, 19 Apr 2009 17:21:42 GMT <link>https://svn.boost.org/trac10/ticket/2961#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2961#comment:1</guid> <description> <p> I'm of course an idiot, the suggested fix is <code> sizeof(boost::math::policies::detail::test_is_policy(static_cast&lt;P*&gt;(0))) </code> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 20 Apr 2009 15:59:25 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/2961#comment:2 https://svn.boost.org/trac10/ticket/2961#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Fixed in Trunk, fix will have to wait for 1.40 now for release branch. </p> <p> Also note that later gcc versions have no such issues. </p> Ticket John Maddock Mon, 20 Apr 2009 16:00:03 GMT <link>https://svn.boost.org/trac10/ticket/2961#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2961#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/52513" title="Fixes #2961. GCC-4.0 workaround.">[52513]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2961" title="#2961: Bugs: Boost 1.38.0 fails to compile on g++-4.0.2 (closed: fixed)">#2961</a>. GCC-4.0 workaround. </p> </description> <category>Ticket</category> </item> <item> <author>Alex Shapiro <alexsh@…></author> <pubDate>Mon, 20 Apr 2009 17:31:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2961#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2961#comment:4</guid> <description> <p> Thanks I know that on later compilers it compiles without an issue. Unfortunately, upgrading the compiler version is problematic. </p> </description> <category>Ticket</category> </item> </channel> </rss>