This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++/6648


> the below fixes this PR, which Peter (Schmid) filed a few hours ago. [...]

Paolo,

WOW! ;-)  I agree that this is an unfortunate failure to ship with.

I believe that a non-interactive test case is producible.  This
non-interactive test fails without your patch:

#include <fstream>

int main ()
{
  const char str_lit01[] = "YYY.txt";
  std::ifstream if01 (str_lit01, std::ios_base::in);
  char buff[2048];
  int i;

  if01.getline(buff, 2048);
  if01.ignore(2048, '\n');
  if01 >> i;
  if (i != 123) exit (1);
}

In YYY.txt:

test\n
123\n
EOF

Can you confirm that it works with your patch? If this non-interactive
version works as well to spot the regression point, please install it
in place or in addition of your interactive version (please adapt it
as required - hints below).

Actually, I think this version goes into 27_io/ifstream_members.cc
instead of narrow_stream_objects thus YYY.txt should be
ifstream_members-2.txt; also convert failure check to use VERIFY().

(I am not commenting on the correctness of your patch.  Only helping
 to ensure that we always test for it, if possible.)

Thanks,
Loren
-- 
Loren J. Rittle
Senior Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]