public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] libstdc++: Fix undefined FILE* operations in test
@ 2021-04-23 10:22 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-23 10:22 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:b84da2d953ec5a3de5d927ca116bc10da664da48

commit b84da2d953ec5a3de5d927ca116bc10da664da48
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 26 11:25:55 2020 +0000

    libstdc++: Fix undefined FILE* operations in test
    
    We only need to check that the constructor doesn't clear errno, so
    there's no need to use an invalid FILE* for that.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/98001
            * testsuite/ext/stdio_filebuf/char/79820.cc: Do not pass invalid
            FILE* to constructor.
    
    (cherry picked from commit 2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc)

Diff:
---
 libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
index c2af0a63c36..4aee84d9165 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
+++ b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
@@ -26,10 +26,11 @@ void
 test01()
 {
   FILE* f = std::fopen("79820.txt", "w");
-  std::fclose(f);
   errno = 127;
   __gnu_cxx::stdio_filebuf<char> b(f, std::ios::out, BUFSIZ);
   VERIFY(errno == 127); // PR libstdc++/79820
+  b.close();
+  std::fclose(f);
 }
 
 int


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 10:22 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] libstdc++: Fix undefined FILE* operations in test Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).