Skip to content
Snippets Groups Projects
Unverified Commit 6eede5ad authored by Jonathan Wakely's avatar Jonathan Wakely Committed by Jonathan Wakely
Browse files

libstdc++: Fix constexpr memory algo tests for COW std::string


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.

Reviewed-by: default avatarGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
parent d6d7da92
No related branches found
No related tags found
No related merge requests found
......@@ -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}});
}
......
......@@ -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>>();
}
......
......@@ -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);
......
......@@ -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));
}
......
......@@ -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>>();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment