diff mbox

PR libstdc++/53984 handle exceptions in basic_istream::sentry

Message ID 20170726220611.GV15340@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely July 26, 2017, 10:06 p.m. UTC
On 26/07/17 20:14 +0200, Paolo Carlini wrote:
>Hi again,
>
>On 26/07/2017 16:27, Paolo Carlini wrote:
>>Hi,
>>
>>On 26/07/2017 16:21, Andreas Schwab wrote:
>>>ERROR: 27_io/basic_fstream/53984.cc: unknown dg option: 
>>>dg-require-file-io 18 {} for " dg-require-file-io 18 "" "
>>Should be already fixed, a trivial typo.
>... but now the new test simply fails for me. If I don't spot 
>something else trivial over the next few hours I guess better waiting 
>for Jon to look into that.

Sorry about that, I must have only checked for FAILs and missed the
ERRORs.

It should have been an ifstream not fstream, otherwise the filebuf
can't even open the file. Fixed like so, committed to trunk.

Comments

Bin.Cheng July 27, 2017, 8:50 a.m. UTC | #1
On Wed, Jul 26, 2017 at 11:06 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
> On 26/07/17 20:14 +0200, Paolo Carlini wrote:
>>
>> Hi again,
>>
>> On 26/07/2017 16:27, Paolo Carlini wrote:
>>>
>>> Hi,
>>>
>>> On 26/07/2017 16:21, Andreas Schwab wrote:
>>>>
>>>> ERROR: 27_io/basic_fstream/53984.cc: unknown dg option:
>>>> dg-require-file-io 18 {} for " dg-require-file-io 18 "" "
>>>
>>> Should be already fixed, a trivial typo.
>>
>> ... but now the new test simply fails for me. If I don't spot something
>> else trivial over the next few hours I guess better waiting for Jon to look
>> into that.
>
>
> Sorry about that, I must have only checked for FAILs and missed the
> ERRORs.
>
> It should have been an ifstream not fstream, otherwise the filebuf
> can't even open the file. Fixed like so, committed to trunk.
Hi, I have seen below failure on aarch64/arm linux/elf:
spawn [open ...]^M
/tmp/.../src/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc:29:
void test01(): Assertion 'in.bad()' failed.
FAIL: 27_io/basic_fstream/53984.cc execution test
extra_tool_flags are:
  -include bits/stdc++.h

Thanks,
bin
>
>
diff mbox

Patch

commit 9c0a34c998843402049165f5e2bb01643da22fb7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Jul 26 23:01:08 2017 +0100

    PR libstdc++/53984 fix failing test
    
    	PR libstdc++/53984
    	* testsuite/27_io/basic_fstream/53984.cc: Fix test.

diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc
index 53c77c2..e49d2b1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc
@@ -23,10 +23,13 @@ 
 void
 test01()
 {
-  std::fstream in(".");
-  int x;
-  in >> x;
-  VERIFY( in.bad() );
+  std::ifstream in(".");
+  if (in)
+  {
+    int x;
+    in >> x;
+    VERIFY( in.bad() );
+  }
 }
 
 int