aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-11-26 11:25:55 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-11-26 11:25:55 +0000
commit2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc (patch)
treed80852dd4b38594ea7c5b3d1f833b37078ac2d1b /libstdc++-v3
parent127aa17e162384034254e93cd1ae37224c0ce197 (diff)
downloadgcc-2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc.zip
gcc-2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc.tar.gz
gcc-2762cb1df686fc1ebcee23c7c4f0f6e8bf5a6abc.tar.bz2
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.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc b/libstdc++-v3/testsuite/ext/stdio_filebuf/char/79820.cc
index c9842d6..aaa398c 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