Boost C++ Libraries: Ticket #4988: [units] improve error messages when quantities are not convertible into one another. https://svn.boost.org/trac10/ticket/4988 <p> Currently, if the quantities are not convertible one into the other (which depends on the included header, etc), the error message is pretty long and unreadable. Specifically in terms of what conversion is being attempted. I suggest the authors consider an improved compiler error message. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4988 Trac 1.4.3 Benaka Moorthi <benaka.moorthi@…> Sat, 19 Feb 2011 11:33:55 GMT attachment set https://svn.boost.org/trac10/ticket/4988 https://svn.boost.org/trac10/ticket/4988 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">patch.tar.bz2</span> </li> </ul> <p> contains patches to provide better error messages </p> Ticket Benaka Moorthi <benaka.moorthi@…> Sat, 19 Feb 2011 11:35:57 GMT <link>https://svn.boost.org/trac10/ticket/4988#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4988#comment:1</guid> <description> <p> I've uploaded an archive w/ two patches that will provide better compiler error messages. GCC will now output error messages similar to those outputted by MSVC, and on every compiler, if derived dimension headers aren't included or the constructed dimension isn't named anywhere, the error message will no longer contain 'dim&lt;X_base_dimension, static_rational&lt;N, D&gt; &gt;' types, but instead 'X&lt;N, D&gt;' types. This should make it easier to see what's going on. I've included a README in the archive detailing my changes. </p> <p> As an example, here is the new output when compiling &amp; running the fail_implicit_conversion test using GCC: ...patience... ...found 719 targets... ...updating 3 targets... gcc.compile.c++ ../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.o fail_implicit_conversion.cpp: In function ‘int main(int, char<strong>)’: fail_implicit_conversion.cpp:32: error: conversion from ‘const boost::units::quantity&lt;boost::units::unit&lt;boost::units::length_dimension, boost::units::si::system, void&gt;, double&gt;’ to non-scalar type ‘const boost::units::quantity&lt;boost::units::unit&lt;boost::units::length_dimension, boost::units::cgs::system, void&gt;, double&gt;’ requested </strong></p> <p> (failed-as-expected) ../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.o <strong>passed</strong> ../../../bin.v2/libs/units/test/fail_implicit_conversion.test/gcc-4.4.3/release/fail_implicit_conversion.test ...updated 3 targets... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sat, 19 Feb 2011 16:42:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4988#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4988#comment:2</guid> <description> <p> This doesn't exactly address what this ticket is about. </p> <p> I'm somewhat concerned by BOOST_UNITS_REGISTER_DIM_ALIAS and friends, as they seems liable to produce ODR violations. </p> </description> <category>Ticket</category> </item> <item> <author>Benaka Moorthi <benaka.moorthi@…></author> <pubDate>Sun, 20 Feb 2011 07:27:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4988#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4988#comment:3</guid> <description> <p> I read the ticket description as an issue regarding the error messages in general, and since I started working w/ GCC, it made sense. If its regarding the instantiation backtrace that shows up when conversion_factor can't be called, this can be fixed fairly easily, so it would probably be faster if someone w/ commit access fixed it (as opposed to me submitting a patch &amp; then someone applying it). And if its regarding something else entirely, its not something I can reproduce (at least w/o a test case). </p> <p> As for the changes I posted, if there is interest in them, let me know. I should be able to fix the ODR issues and clean up my patch in the process. I can also add the conversion_factor fix. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Matthias Schabel</dc:creator> <pubDate>Thu, 14 Jul 2011 23:06:43 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/4988#comment:4 https://svn.boost.org/trac10/ticket/4988#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matthias Schabel</span> to <span class="trac-author">Steven Watanabe</span> </li> </ul> Ticket