The old COW std::string is not usable in constant expressions, so these
new tests fail with -D_GLIBCXX_USE_CXX11_ABI=0.

The parts of the tests using std::string can be conditionally skipped.

libstdc++-v3/ChangeLog:

        * 
testsuite/20_util/specialized_algorithms/uninitialized_copy/constexpr.cc:
        Do not test COW std::string in constexpr contexts.
        * 
testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constexpr.cc:
        Likewise.
        * 
testsuite/20_util/specialized_algorithms/uninitialized_fill/constexpr.cc:
        Likewise.
        * 
testsuite/20_util/specialized_algorithms/uninitialized_move/constexpr.cc:
        Likewise.
        * 
testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constexpr.cc:
        Likewise.
---

Tested x86_64-linux.

 .../specialized_algorithms/uninitialized_copy/constexpr.cc      | 2 ++
 .../uninitialized_default_construct/constexpr.cc                | 2 ++
 .../specialized_algorithms/uninitialized_fill/constexpr.cc      | 2 ++
 .../specialized_algorithms/uninitialized_move/constexpr.cc      | 2 ++
 .../uninitialized_value_construct/constexpr.cc                  | 2 ++
 5 files changed, 10 insertions(+)

diff --git 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/constexpr.cc
 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/constexpr.cc
index 6f05b0ce309..faf69689ee7 100644
--- 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/constexpr.cc
+++ 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/constexpr.cc
@@ -51,7 +51,9 @@ test01()
     test01_impl<char>({'a', 'b', 'c'}) &&
     test01_impl<int>({1, 2, 3, 4}) &&
     test01_impl<double>({1.0, 2.0, 3.0, 4.0}) &&
+#if _GLIBCXX_USE_CXX11_ABI
     test01_impl<std::string>({"a", "b", "cc", "dddd", "eeeeeeeeeeeeeeee"}) &&
+#endif
     test01_impl<std::vector<int>>({ {0}, {0, 1}, {0, 1, 2}});
 }
 
diff --git 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constexpr.cc
 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constexpr.cc
index db39c8b4d05..151c1f95a30 100644
--- 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constexpr.cc
+++ 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_default_construct/constexpr.cc
@@ -59,7 +59,9 @@ test01()
     test01_impl<char>() &&
     test01_impl<int>() &&
     test01_impl<double>() &&
+#if _GLIBCXX_USE_CXX11_ABI
     test01_impl<std::string>() &&
+#endif
     test01_impl<std::vector<int>>() &&
     test01_impl<std::unique_ptr<int>>();
 }
diff --git 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/constexpr.cc
 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/constexpr.cc
index e43cd35a92d..27461fa452e 100644
--- 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/constexpr.cc
+++ 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_fill/constexpr.cc
@@ -58,8 +58,10 @@ test01()
     test01_impl<int>(0) &&
     test01_impl<int>(42) &&
     test01_impl<double>(3.14) &&
+#if _GLIBCXX_USE_CXX11_ABI
     test01_impl<std::string>() &&
     test01_impl<std::string>(std::string("test")) &&
+#endif
     test01_impl<std::vector<int>>() &&
     test01_impl<std::vector<int>>({1, 2, 3, 4}) &&
     test01_impl<std::unique_ptr<int>>(nullptr);
diff --git 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constexpr.cc
 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constexpr.cc
index 47403ae706d..f122a03991f 100644
--- 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constexpr.cc
+++ 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_move/constexpr.cc
@@ -43,7 +43,9 @@ test01()
     test01_impl<char>({'a', 'b', 'c'}) &&
     test01_impl<int>({1, 2, 3, 4}) &&
     test01_impl<double>({1.0, 2.0, 3.0, 4.0}) &&
+#if _GLIBCXX_USE_CXX11_ABI
     test01_impl<std::string>({"a", "b", "cc", "dddd", "eeeeeeeeeeeeeeee"}) &&
+#endif
     test01_impl<std::vector<int>>({ {0}, {0, 1}, {0, 1, 2}}) &&
     test01_impl<std::unique_ptr<int>>(std::vector<std::unique_ptr<int>>(10));
 }
diff --git 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constexpr.cc
 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constexpr.cc
index 55dfc59b5ef..f943973b015 100644
--- 
a/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constexpr.cc
+++ 
b/libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_value_construct/constexpr.cc
@@ -56,7 +56,9 @@ test01()
     test01_impl<char>() &&
     test01_impl<int>() &&
     test01_impl<double>() &&
+#if _GLIBCXX_USE_CXX11_ABI
     test01_impl<std::string>() &&
+#endif
     test01_impl<std::vector<int>>() &&
     test01_impl<std::unique_ptr<int>>();
 }
-- 
2.48.1

Reply via email to