Opened 10 years ago
Closed 9 years ago
#7025 closed Bugs (fixed)
circular buffer reports warning: " type qualifiers ignored on function return type" while compile.
| Reported by: | Owned by: | viboes | |
|---|---|---|---|
| Milestone: | Boost 1.55.0 | Component: | circular_buffer |
| Version: | Boost 1.49.0 | Severity: | Problem |
| Keywords: | Cc: |
Description (last modified by )
If using circular in my application, GCC will report warning as:
../../../packages/target/libboost_1_49_0/include/boost/circular_buffer/base.hpp:386: warning: type qualifiers ignored on function return type ../../../packages/target/libboost_1_49_0/include/boost/circular_buffer/base.hpp:424: warning: type qualifiers ignored on function return type ../../../packages/target/libboost_1_49_0/include/boost/circular_buffer/base.hpp:478: warning: type qualifiers ignored on function return type ../../../packages/target/libboost_1_49_0/include/boost/circular_buffer/base.hpp:496: warning: type qualifiers ignored on function return type
I think it's caused by the "const" decorator.
Change History (8)
comment:1 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 9 years ago
| Component: | circular_buffer → call_traits |
|---|
comment:4 by , 9 years ago
| Owner: | changed from to |
|---|---|
| Status: | assigned → new |
comment:5 by , 9 years ago
| Owner: | changed from to |
|---|
I'm unable to reproduce here - anyone have a test case?
In any case, circular_buffer is abusing call_traits::param_type which is designed for parameters and not return values. And yes it really should be const ;-)
Use call_traits::value_type or call_traits::const_reference for those return types (I think I would settle for the latter).
comment:6 by , 9 years ago
| Component: | call_traits → circular_buffer |
|---|
You are right. As the documentation states, the return type should be const_reference.
comment:8 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

I suspect that this need a change in boost/detail/call_traits.hpp
The following
template <typename T> struct ct_imp2<T, true> { typedef const T param_type; };should be
template <typename T> struct ct_imp2<T, true> { typedef T param_type; };