Subject: [Boost-bugs] [Boost C++ Libraries] #7365: warning: type qualifiers ignored on function return type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-11 10:03:52
#7365: warning: type qualifiers ignored on function return type
------------------------------+---------------------------------------------
Reporter: anonymous | Owner: rogeeff
Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.50.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
Dears,
I have some flood of warnings like:
../../../../externals/boost/test/utils/basic_cstring/basic_cstring.hpp: In
instantiation of 'boost::unit_test::basic_cstring<const char>':
../../../../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
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.
The compiler ignores in return type when using const T instead of T.
It seems to be because:
basic_cstring<CharT>::value_type
for
"basic_cstring<const char>::value_type == const char" but
"const char == char" when returned as value.
I do not see simple patch without using e.g. Boost::MPL and remove const
when return value is done as copy by value.
Regards,
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7365> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC