This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/12065] Strange fpos arithmetic.
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2003 13:26:10 -0000
- Subject: [Bug libstdc++/12065] Strange fpos arithmetic.
- References: <20030826132425.12065.peturr02@ru.is>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.