These tests rely on inlining, so if -fno-inline is added to the compiler
flags the tests fail. Use the predefined __NO_INLINE__ macro to detect
that situation, and don't bother testing the move assignment.
* testsuite/21_strings/basic_string/modifiers/assign/char/
move_assign_optim.cc: Avoid spurious failure when -fno-inline added
to test flags.
* testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
move_assign_optim.cc: Likewise.
From-SVN: r267573
+2019-01-04 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/21_strings/basic_string/modifiers/assign/char/
+ move_assign_optim.cc: Avoid spurious failure when -fno-inline added
+ to test flags.
+ * testsuite/21_strings/basic_string/modifiers/assign/wchar_t/
+ move_assign_optim.cc: Likewise.
+
2019-01-03 Jonathan Wakely <jwakely@redhat.com>
Jakub Jelinek <jakub@redhat.com>
// The move assignment operator should be simple enough that the compiler
// can see that it never results in a length_error or bad_alloc exception
// (which would be turned into std::terminate by the noexcept on the
- // assignment operator).
+ // assignment operator). This is only true when inlining though.
+#ifndef __NO_INLINE__
target = std::move(source);
+#endif
}
// The move assignment operator should be simple enough that the compiler
// can see that it never results in a length_error or bad_alloc exception
// (which would be turned into std::terminate by the noexcept on the
- // assignment operator).
+ // assignment operator). This is only true when inlining though.
+#ifndef __NO_INLINE__
target = std::move(source);
+#endif
}