[git commit] tests: tweak utilitytest

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Wed Oct 3 15:28:31 UTC 2018


commit: https://git.uclibc.org/uClibc++/commit/?id=f7257ac41d7fc512fa86b2c1eddec8824c156f5a
branch: https://git.uclibc.org/uClibc++/commit/?id=refs/heads/master

in c++-11 and later, pair's move constructor makes d deleted so cannot
be used.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 tests/utilitytest.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/utilitytest.cpp b/tests/utilitytest.cpp
index 0f9d14a..19e19fc 100644
--- a/tests/utilitytest.cpp
+++ b/tests/utilitytest.cpp
@@ -191,15 +191,17 @@ bool checkpair_opsCopyConstructor(){
 	b = std::pair<char, int>('b', 61473);
 
 	std::pair<char, int> c(b);
-	
+
 	return c.first == 'b' && c.second == 61473;
 }
 bool checkpair_opsReplacementAssignment(){
 	std::pair<Foo, Foo> d = std::pair<Foo, Foo>(5, 18);
 	std::pair<Foo, Foo> e(d);
 
+#if __cplusplus < 201103L
+	/* no move, so not deleted */
 	e = d;
-	
+#endif
 	return e.first == 5 && e.second == 18;
 }
 


More information about the uClibc-cvs mailing list