[Bug libstdc++/12065] Strange fpos arithmetic.
peturr02 at ru dot is
gcc-bugzilla@gcc.gnu.org
Tue Aug 26 13:26:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12065
------- Additional Comments From peturr02 at ru dot is 2003-08-26 13:26 -------
Created an attachment (id=4653)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4653&action=view)
Test case
Here is the output I get from running this program:
typeid(p) = std::fpos<__mbstate_t>
typeid(q) = std::fpos<__mbstate_t>
typeid(o) = l
typeid(p + o) = std::fpos<__mbstate_t>
typeid(q + o) = l
typeid(p - o) = std::fpos<__mbstate_t>
typeid(q - o) = l
typeid(p - q) = std::fpos<__mbstate_t>
typeid(q - p) = l
Note how the type of the result changes depending on only the constness of
the arguments.
More information about the Gcc-bugs
mailing list