Boost C++ Libraries: Ticket #4068: Borland also needs private/public workaround in boost::exception https://svn.boost.org/trac10/ticket/4068 <p> <a class="missing wiki">Borland/CodeGear</a> currently won't compile boost::exception, because it cannot deal with the friend declarations of exception_detail::set_info, inside the boost::exception class definition. So please consider applying the attached patch. It leaves the data of boost::exception public, when <code>__BORLANDC__&lt;=0x621</code>, just like you did for other compilers. </p> <p> Note: I have no idea whether the workaround is still needed when <code>__BORLANDC__&gt;0x621</code>. It's just that I only tested <a class="missing wiki">Embarcadero/CodeGear</a> C++ 6.21. But older Borland versions certainly have the same problem. For example, <a href="http://www.boost.org/development/tests/trunk/output/siliconman-boost-bin-v2-libs-exception-test-all_hpp_test-test-borland-5-9-3-debug.html">http://www.boost.org/development/tests/trunk/output/siliconman-boost-bin-v2-libs-exception-test-all_hpp_test-test-borland-5-9-3-debug.html</a> says: </p> <pre class="wiki">..\libs\exception\test\all_hpp_test.cpp: Error E2401 ..\boost/exception/exception.hpp 228: Invalid template argument list Error E2401 ..\boost/exception/exception.hpp 231: Invalid template argument list Error E2401 ..\boost/exception/exception.hpp 234: Invalid template argument list Error E2401 ..\boost/exception/exception.hpp 237: Invalid template argument list Error E2109 ..\boost/exception/exception.hpp 337: Not an allowed type Error E2228 ..\boost/exception/exception.hpp 337: Too many error or warning messages *** 6 errors in Compile *** </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4068 Trac 1.4.3 Emil Dotchevski Mon, 05 Apr 2010 17:26:44 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4068#comment:1 https://svn.boost.org/trac10/ticket/4068#comment:1 <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">wontfix</span> </li> </ul> <p> Thanks for the patch however I am not applying it because most tests will fail on Borland anyway. The only tests that must pass on *all* compilers are the top 4 in the test matrix, numbered 1-4; these verify that Boost Exception is turned off on non-conformant compilers so that boost::throw_exception works. </p> <p> I will provide support to anyone wanting to produce and support a Borland implementation of Boost Exception. Personally, I gave up on Borland long time ago. :) </p> Ticket niels_dekker Mon, 05 Apr 2010 18:30:13 GMT <link>https://svn.boost.org/trac10/ticket/4068#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:2</guid> <description> <p> Excuse me? The patch is extremely simple. You already added the same very workaround to MSVC 7.1 and Metroworks. Just add "<code>|| defined(__BORLANDC__)</code>" to the <code>#if</code> at <a class="ext-link" href="https://svn.boost.org/trac/boost/browser/trunk/boost/exception/exception.hpp#L222"><span class="icon">​</span>line 222 of exception.hpp</a> and it's ready. </p> <p> Personally I feel I have a responsibility for utility/value_init_test.cpp, which does not use boost::exception in any way, but still gets the compile errors: <a href="http://www.boost.org/development/tests/trunk/developer/output/siliconman-boost-bin-v2-libs-utility-test-value_init_test-test-borland-6-2-1-debug.html">http://www.boost.org/development/tests/trunk/developer/output/siliconman-boost-bin-v2-libs-utility-test-value_init_test-test-borland-6-2-1-debug.html</a> </p> <p> <a href="http://www.boost.org/development/tests/trunk/output/siliconman-boost-bin-v2-libs-utility-test-value_init_test-test-borland-6-2-1-debug.html">http://www.boost.org/development/tests/trunk/output/siliconman-boost-bin-v2-libs-utility-test-value_init_test-test-borland-6-2-1-debug.html</a> </p> <p> What should I do to fix them? </p> <p> Would it be okay to you if I commit the little patch to <a class="ext-link" href="https://svn.boost.org/svn/boost/trunk/boost/exception/exception.hpp"><span class="icon">​</span>exception.hpp</a>? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>niels_dekker</dc:creator> <pubDate>Sat, 10 Apr 2010 14:33:09 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4068 https://svn.boost.org/trac10/ticket/4068 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">exception_for Borland.patch</span> </li> </ul> <p> private/public-patch for <a class="missing wiki">Borland/CodeGear</a>, tested on <a class="missing wiki">CodeGear</a> 2010. Update: now using BOOST_WORKAROUND. </p> Ticket peter.myerscough-jackopson@… Thu, 10 Jun 2010 10:05:26 GMT <link>https://svn.boost.org/trac10/ticket/4068#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:3</guid> <description> <p> As a step towards the affore mentioned goal of assisting those with the Codegear compiler, could you add this patch, and slowly more and more support can be added for this compiler, which some of us must work with, and would also like to work with Boost as much as possible too, it appears the only reason for blocking ths patch is ideological, rather than technical. </p> <p> Please reconsider, </p> <p> Peter Myerscough-Jackopson </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Thu, 10 Jun 2010 18:35:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:4</guid> <description> <p> Are you willing to port Boost Exception to Codegear so at least some of the tests at <a href="http://www.boost.org/development/tests/trunk/developer/exception.html">http://www.boost.org/development/tests/trunk/developer/exception.html</a> pass? For example, try to get adding error_info and getting error_info to work. Otherwise, the patch is pointless, IMHO. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>niels_dekker</dc:creator> <pubDate>Thu, 10 Jun 2010 22:01:18 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:5</guid> <description> <p> I can certainly have a look and see if Codegear compatibility can be further increased. (But I don't commit myself to solving all remaining Codegear issues.) </p> <p> The very little patch I proposed here already fixes the Codegear compile error triggered by merely doing <code> #include &lt;boost/exception/exception.hpp&gt; </code> </p> <p> <code>exception.hpp</code> is included by Boost Test, even while a lot of unit tests don't actually use boost::exception at runtime. So I think the patch could help to get more unit tests at the Boost regression page compiling on Codegear. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Fri, 11 Jun 2010 00:20:17 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4068#comment:6 https://svn.boost.org/trac10/ticket/4068#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> </ul> <p> The reason why boost/excption/exception.hpp doesn't have Codegear-specific support is that currently none of the tests would work on Codegear anyway. If you get at least some tests working, I'll accept the patch. </p> <p> Thanks, Emil </p> Ticket Emil Dotchevski Fri, 11 Jun 2010 00:21:16 GMT owner, status changed https://svn.boost.org/trac10/ticket/4068#comment:7 https://svn.boost.org/trac10/ticket/4068#comment:7 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Emil Dotchevski</span> to <span class="trac-author">niels_dekker</span> </li> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket niels_dekker Fri, 11 Jun 2010 21:44:23 GMT <link>https://svn.boost.org/trac10/ticket/4068#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:8</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62819" title="Added Borland/Codegear workaround to avoid compile error when doing ...">[62819]</a>) Added <a class="missing wiki">Borland/Codegear</a> workaround to avoid compile error when doing #include &lt;boost/exception/exception.hpp&gt; -- see <a class="new ticket" href="https://svn.boost.org/trac10/ticket/4068" title="#4068: Patches: Borland also needs private/public workaround in boost::exception (new)">#4068</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>niels_dekker</dc:creator> <pubDate>Fri, 11 Jun 2010 21:52:50 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4068#comment:9 https://svn.boost.org/trac10/ticket/4068#comment:9 <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> </ul> <p> Thanks Emil and Peter. FYI, on my computer, commit <a class="changeset" href="https://svn.boost.org/trac10/changeset/62819" title="Added Borland/Codegear workaround to avoid compile error when doing ...">[62819]</a> fixes the Codegear 2010 compile errors of many header tests, including all_hpp_test, diagnostic_information_hpp_test, errinfo_errno_hpp_test, exception_ptr_hpp_test, get_error_info_hpp_test, info_hpp_test, and info_tuple_hpp_test. </p> <p> Hereby resolved as fixed. </p> Ticket Emil Dotchevski Fri, 11 Jun 2010 22:09:13 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/4068#comment:10 https://svn.boost.org/trac10/ticket/4068#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> Ticket Emil Dotchevski Fri, 11 Jun 2010 22:13:25 GMT status changed https://svn.boost.org/trac10/ticket/4068#comment:11 https://svn.boost.org/trac10/ticket/4068#comment:11 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">new</span> </li> </ul> <p> The fact that header files compile doesn't mean that any tests are working. Did you run the tests? Which ones work now? </p> <p> Also, please don't include any headers in boost/exception/exception.hpp, not even boost/detail/workaround.hpp (it is OK to include workaround.hpp in other Boost Exception headers, just not this one.) </p> Ticket niels_dekker Fri, 11 Jun 2010 23:01:32 GMT <link>https://svn.boost.org/trac10/ticket/4068#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:12</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62824" title="Removed #include &lt;boost/detail/workaround.hpp&gt; from exception.hpp, ...">[62824]</a>) Removed #include &lt;boost/detail/workaround.hpp&gt; from exception.hpp, requested by Emil, see <a class="new ticket" href="https://svn.boost.org/trac10/ticket/4068" title="#4068: Patches: Borland also needs private/public workaround in boost::exception (new)">#4068</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>niels_dekker</dc:creator> <pubDate>Fri, 11 Jun 2010 23:03:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:13</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4068#comment:11" title="Comment 11">emildotchevski</a>: </p> <blockquote class="citation"> <p> The fact that header files compile doesn't mean that any tests are working. Did you run the tests? Which ones work now? </p> </blockquote> <p> On my computer, exception_test and refcount_ptr_test now run successfully, while they had Codegear 2010 compile errors before commit <a class="changeset" href="https://svn.boost.org/trac10/changeset/62819" title="Added Borland/Codegear workaround to avoid compile error when doing ...">[62819]</a>. </p> <p> Note: I'm offline in a few minutes. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Fri, 11 Jun 2010 23:39:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:14</guid> <description> <p> The refcount_ptr_test doesn't check any "official" Boost Exception functionality, that is, it is a critical test but only if adding and removing error info works. </p> <p> The exception_test verifies that the boost::exception class compiles. The boost::exception class does not implement any functionality, it serves as an abstract interface for things implemented in other headers. </p> <p> At some point boost/exception/exception.hpp had similar ifdefs for Codegear to the ones you introduced. I removed them because they don't do any good beyond making that header compile. I would suggest reverting the patch until at least *some* subset of Boost Exception functionality is available on Codegear. </p> <p> Please let me know if you need any help understanding the Boost Exception code, I'll be more than happy to help in supporting Codegear as well. </p> <p> Thanks, Emil </p> </description> <category>Ticket</category> </item> <item> <dc:creator>niels_dekker</dc:creator> <pubDate>Sat, 12 Jun 2010 13:32:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:15</guid> <description> <p> For your information, I have just reported the Borland / Codegear compiler bug to Embarcadero: C++Builder Report 85387, "Friend function template in namespace triggers error E2401", <a class="ext-link" href="http://qc.embarcadero.com/wc/qcmain.aspx?d=85387"><span class="icon">​</span>http://qc.embarcadero.com/wc/qcmain.aspx?d=85387</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 30 Jul 2011 22:31:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:16</guid> <description> <p> Probably a better fix would be to #include &lt;boost/config.hpp&gt; and check for BOOST_NO_MEMBER_TEMPLATE_FRIENDS. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Sat, 30 Jul 2011 22:39:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4068#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4068#comment:17</guid> <description> <p> Borland is not a supported platform for Boost Exception. The functionality for unsupported platforms is limited to the the classical boost::throw_exception behavior. Formally this is checked by the first 4 tests in <a href="http://www.boost.org/development/tests/trunk/developer/exception.html">http://www.boost.org/development/tests/trunk/developer/exception.html</a>. AFAIK, they work for Borland and all other platforms. </p> </description> <category>Ticket</category> </item> </channel> </rss>