From 5e652dbf9be9523c13799452324b8c8490b52dfa Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 26 May 2016 18:33:17 +0100 Subject: [PATCH] libstdc++/70762 fix fallback implementation of nonexistent_path Backport from mainline 2016-04-24 Jonathan Wakely PR libstdc++/70762 * testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use static counter to return a different path on every call. From-SVN: r236788 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/testsuite/util/testsuite_fs.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 91cbc28c95c5..0ee572a85445 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2016-05-26 Jonathan Wakely + Backport from mainline + 2016-04-24 Jonathan Wakely + + PR libstdc++/70762 + * testsuite/util/testsuite_fs.h (__gnu_test::nonexistent_path): Use + static counter to return a different path on every call. + * testsuite/experimental/filesystem/path/native/string.cc: Add dg-require-filesystem-ts directive. diff --git a/libstdc++-v3/testsuite/util/testsuite_fs.h b/libstdc++-v3/testsuite/util/testsuite_fs.h index 524972ece9b7..ddcb2b7e3959 100644 --- a/libstdc++-v3/testsuite/util/testsuite_fs.h +++ b/libstdc++-v3/testsuite/util/testsuite_fs.h @@ -83,7 +83,9 @@ namespace __gnu_test p = tmp; #else char buf[64]; - std::sprintf(buf, "test.%lu", (unsigned long)::getpid()); + static int counter; + std::sprintf(buf, "filesystem-ts-test.%d.%lu", counter++, + (unsigned long) ::getpid()); p = buf; #endif return p;