summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2017-11-17 14:07:58 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2017-11-17 14:07:58 +0000
commit96e0367ead5d8dcac3bec2865582e76e2fbab190 (patch)
tree7206a6f455f377e8e51d9d7466c82d36a3e08a50 /libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
parent610f66a3d14e56dee60cd542579ffbf14f803d80 (diff)
downloadgcc-96e0367ead5d8dcac3bec2865582e76e2fbab190.tar.gz
PR libstdc++/83025 fix constraints for path overloads in <fstream>
PR libstdc++/83025 * include/std/fstream (basic_filebuf::_If_path): Move to namespace-scope and rename to _If_fs_path. (basic_filebuf::open): Use new name. (basic_ifstream(_Path, ios::openmode)) (basic_ifstream::open(_Path, ios::openmode)) (basic_ofstream(_Path, ios::openmode)) (basic_ofstream::open(_Path, ios::openmode)) (basic_fstream(_Path, ios::openmode)) (basic_fstream::open(_Path, ios::openmode)): Use _If_fs_path. * testsuite/27_io/basic_filebuf/open/char/path.cc: Test with filename as non-const char*. * testsuite/27_io/basic_fstream/cons/char/path.cc: Likewise. * testsuite/27_io/basic_fstream/open/char/path.cc: Likewise. * testsuite/27_io/basic_ifstream/cons/char/path.cc: Likewise. * testsuite/27_io/basic_ifstream/open/char/path.cc: Likewise. * testsuite/27_io/basic_ofstream/cons/char/path.cc: Likewise. * testsuite/27_io/basic_ofstream/open/char/path.cc: Likewise. From-SVN: r254871
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc')
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
index 192e0fe9e85..49b8c1e4dc4 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/path.cc
@@ -24,7 +24,8 @@
#include <filesystem>
#include <testsuite_hooks.h>
-const std::filesystem::path filename = "ifstream_members-1.tst";
+char cstr[] = "filebuf_members-1.tst";
+const std::filesystem::path filename = cstr;
void
test01()
@@ -42,6 +43,14 @@ test02()
VERIFY( f.is_open() );
}
+void
+test03() // compile-only
+{
+ std::ifstream f;
+ f.open(cstr); // PR libstdc++/83025
+ f.open(cstr, std::ios::in); // PR libstdc++/83025
+}
+
int
main()
{