[libstdc++] Protect against Koenig lookup

Phil Edwards phil@jaj.com
Wed Nov 20 23:27:00 GMT 2002


When calling non-uglified member functions, we have to ward against unwanted
Koenig lookup.  At some point in ages past, somebody missed a spot.

Tested on athlon_mp-pc-linux-gnu.  No new regressions.

I can't think of a test to add to the testsuite, other than making a
red-herring global pbackfail() function with the same signature and then
checking for misbehavior after a call to putback.  And I'm not sure that
would catch it.  Opinions?


Committed to trunk, queued for 3.2.2.



2002-11-21  Phil Edwards  <pme@gcc.gnu.org>

	* include/bits/streambuf.tcc (basic_streambuf::sputbackc):  Prefix
	"this->" to call to pbackfail.


Index: include/bits/streambuf.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/streambuf.tcc,v
retrieving revision 1.20
diff -u -3 -p -r1.20 streambuf.tcc
--- include/bits/streambuf.tcc	20 Nov 2002 21:22:48 -0000	1.20
+++ include/bits/streambuf.tcc	21 Nov 2002 07:21:13 -0000
@@ -69,7 +69,7 @@ namespace std 
       bool __testpos = _M_in_cur && _M_in_beg < _M_in_cur;
       bool __testne = _M_in_cur && !traits_type::eq(__c, this->gptr()[-1]);
       if (!__testpos || __testne)
-	__ret = pbackfail(traits_type::to_int_type(__c));
+	__ret = this->pbackfail(traits_type::to_int_type(__c));
       else 
 	{
 	  _M_in_cur_move(-1);



More information about the Gcc-patches mailing list