Opened 14 years ago
Closed 13 years ago
#2015 closed Bugs (fixed)
boost::format::operator% does not work with anonymous types inside a namespace
Reported by: | Owned by: | Samuel Krempp | |
---|---|---|---|
Milestone: | To Be Determined | Component: | format |
Version: | Boost 1.34.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Using g++ version 3.3.3. Actual sources are from 1.33.1 but these don't seem to be different from what is currently in the repository. I get the following error message. If I remove the template specification from the calls in the body of several functions, the errors go away. In the attached file, the function foo2 suffers the same problem as operator% but foo1 does not.
With g++ 4.2.1, this change does not work either.
.../boost/format/format_class.hpp: In
member function `boost::basic_format<Ch, Tr, Alloc>& boost::basic_format<Ch, Tr, Alloc>::operator%(const T&) [with T = bcu::<anonymous enum>, Ch = char, Tr = std::char_traits<char>, Alloc = std::allocator<char>]':
format_bug.cc:52: instantiated from here .../boost/format/format_class.hpp:64: error: template-argument
`const bcu::<anonymous enum>&' uses anonymous type
.../boost/format/format_class.hpp:64: error: no
matching function for call to `feed(boost::basic_format<char, std::char_traits<char>, std::allocator<char> >&, const bcu::<anonymous enum>&)'
Attachments (2)
Change History (3)
by , 14 years ago
Attachment: | format_bug.cc added |
---|
comment:1 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed by applying suggested patch (in revision 57695) Thanks to Steven Watanabe for the fix.
program that reproduces the problem