This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[libstdc++ PATCH] Trivial fix for char_traits::not_eof
- From: Doug Gregor <dgregor at apple dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Aug 2003 15:43:56 -0700
- Subject: [libstdc++ PATCH] Trivial fix for char_traits::not_eof
The types of the latter two operands to ? : in the generic
char_traits::not_eof don't match, so we break with class types that
allow implicit conversions to and from int_type. Calls to_int_type() to
make sure the types are the same.
Okay for mainline?
Doug
ChangeLog:
2003-08-05 Doug Gregor <dgregor@apple.com>
* include/bits/char_traits.h (char_traits::not_eof): Match operand
types in ? :.
Index: char_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/char_traits.h,v
retrieving revision 1.21
diff -u -r1.21 char_traits.h
--- char_traits.h 25 Jul 2003 16:35:38 -0000 1.21
+++ char_traits.h 7 Aug 2003 22:39:26 -0000
@@ -140,7 +140,7 @@
static int_type
not_eof(const int_type& __c)
- { return !eq_int_type(__c, eof()) ? __c : char_type(); }
+ { return !eq_int_type(__c, eof()) ? __c :
to_int_type(char_type()); }
};
template<typename _CharT>