From: Jonathan Wakely Date: Fri, 16 Jun 2017 08:13:37 +0000 (+0100) Subject: Fix missing returns in libstdc++ header and tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ec3c9c841aea8b492aa2fc0db5d3c734b643725;p=gcc.git Fix missing returns in libstdc++ header and tests * include/bits/locale_conv.h (wbuffer_convert::_M_put): Add missing return statement. * testsuite/21_strings/basic_string_view/operations/copy/char/1.cc: Return void. * testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc: Likewise. * testsuite/23_containers/map/modifiers/insert_or_assign/1.cc: Add missing return statements. * testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc: Return void. * testsuite/special_functions/14_expint/pr68397.cc: Likewise. From-SVN: r249238 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 26b3075143d..09d1abe4fb7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2017-06-16 Jonathan Wakely + + * include/bits/locale_conv.h (wbuffer_convert::_M_put): Add missing + return statement. + * testsuite/21_strings/basic_string_view/operations/copy/char/1.cc: + Return void. + * testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc: + Likewise. + * testsuite/23_containers/map/modifiers/insert_or_assign/1.cc: Add + missing return statements. + * testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc: + Likewise. + * testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc: + Return void. + * testsuite/special_functions/14_expint/pr68397.cc: Likewise. + 2017-06-16 François Dumont * include/bits/stl_bvector.h diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h index 9b952d45165..74beaec5ae6 100644 --- a/libstdc++-v3/include/bits/locale_conv.h +++ b/libstdc++-v3/include/bits/locale_conv.h @@ -482,6 +482,7 @@ _GLIBCXX_END_NAMESPACE_CXX11 { if (_M_buf->sputn(__p, __n) < __n) return false; + return true; } // convert the put area and write to the byte stream buffer diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc index 88a74f6ee87..c2d195122c8 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/char/1.cc @@ -22,7 +22,7 @@ #include #include -bool +void test01() { typedef std::string_view::size_type csize_type; diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc index 0e625d638a7..957c80c5a33 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc @@ -22,7 +22,7 @@ #include #include -bool +void test01() { typedef std::wstring_view::size_type csize_type; diff --git a/libstdc++-v3/testsuite/23_containers/map/modifiers/insert_or_assign/1.cc b/libstdc++-v3/testsuite/23_containers/map/modifiers/insert_or_assign/1.cc index 48c17ebc5ef..aaf5d8a888b 100644 --- a/libstdc++-v3/testsuite/23_containers/map/modifiers/insert_or_assign/1.cc +++ b/libstdc++-v3/testsuite/23_containers/map/modifiers/insert_or_assign/1.cc @@ -39,10 +39,12 @@ struct Val { val = other.val; other.moved_from_assign = true; + return *this; } Val& operator=(const Val& other) { val = other.val; + return *this; } }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc index 67fd164a370..d4b9601c1ca 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc @@ -38,10 +38,12 @@ struct Val { val = other.val; other.moved_from_assign = true; + return *this; } Val& operator=(const Val& other) { val = other.val; + return *this; } }; diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc index 24cd2f5d4be..7e3b7737285 100644 --- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc +++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc @@ -50,7 +50,7 @@ void test12_aux(bool integer_type) VERIFY(is.fail()); } -bool test12() +void test12() { test12_aux(true); test12_aux(true); diff --git a/libstdc++-v3/testsuite/special_functions/14_expint/pr68397.cc b/libstdc++-v3/testsuite/special_functions/14_expint/pr68397.cc index 8da16d1fc69..9527f4050ad 100644 --- a/libstdc++-v3/testsuite/special_functions/14_expint/pr68397.cc +++ b/libstdc++-v3/testsuite/special_functions/14_expint/pr68397.cc @@ -23,7 +23,7 @@ #include #include -int +void test01() { // Answers from Wolfram Alpha.