Boost C++ Libraries: Ticket #7365: warning: type qualifiers ignored on function return type https://svn.boost.org/trac10/ticket/7365 <p> Dears, </p> <p> I have some flood of warnings like: </p> <p> ../../../../externals/boost/test/utils/basic_cstring/basic_cstring.hpp: In instantiation of 'boost::unit_test::basic_cstring&lt;const char&gt;': ../../../../externals/boost/test/predicate_result.hpp:73: instantiated from here ../../../../externals/boost/test/utils/basic_cstring/basic_cstring.hpp:209: warning: type qualifiers ignored on function return type ../../../../externals/boost/test/utils/basic_cstring/basic_cstring.hpp:218: warning: type qualifiers ignored on function return type </p> <p> My explanation is that, the problem is in basic_cstring function, that works with "const T" and "T" as template, but return type ignores "const" qualifier when returns copy of the object. </p> <p> The compiler ignores in return type when using const T instead of T. </p> <p> It seems to be because: </p> <p> basic_cstring&lt;CharT&gt;::value_type </p> <p> for </p> <p> "basic_cstring&lt;const char&gt;::value_type == const char" but "const char == char" when returned as value. </p> <p> I do not see simple patch without using e.g. Boost::MPL and remove const when return value is done as copy by value. </p> <p> Regards, </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7365 Trac 1.4.3 habdank@… Tue, 11 Sep 2012 10:04:56 GMT <link>https://svn.boost.org/trac10/ticket/7365#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7365#comment:1</guid> <description> <p> I forgot mail. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gennadiy Rozental</dc:creator> <pubDate>Mon, 05 Nov 2012 03:16:15 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7365#comment:2 https://svn.boost.org/trac10/ticket/7365#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> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81184" title="Fixes #7365">[81184]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7365" title="#7365: Bugs: warning: type qualifiers ignored on function return type (closed: fixed)">#7365</a> </p> Ticket