gcc/libstdc++-v3/testsuite/21_strings
Jonathan Wakely 956077257a libstdc++: Suppress -Wstringop-overread warning in test
When compiled with -m32 -O2 -D_GLIBCXX_USE_CXX11_ABI=0 we get a warning
for 21_strings/basic_string/cons/char/1.cc:

bits/char_traits.h:409:56: warning: ‘void* __builtin_memcpy(void*, const void*, unsigned int)’ reading 1073741821 bytes from a region of size 19 [-Wstringop-overread]

The warning is legitimate, even if that line cannot be reached because
we throw std::length_error before getting there. Since the invalid
length is deliberate (and mentioned in a comment) just suppress the
warning, so that the test can verify we get the exception.

Also remove an unused typedef that produces another warning.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/cons/char/1.cc: Use
	diagnostic pragma to suppress -Wstringop-overread error.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 92edc4a768)
2021-06-18 11:16:58 +01:00
..
basic_string libstdc++: Suppress -Wstringop-overread warning in test 2021-06-18 11:16:58 +01:00
basic_string_view libstdc++: Use __builtin_unreachable for constexpr assertions [PR 100676] 2021-06-02 14:43:20 +01:00
c_strings Update copyright years. 2021-01-04 10:26:59 +01:00
char_traits/requirements libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
debug Update copyright years. 2021-01-04 10:26:59 +01:00
headers Update copyright years. 2021-01-04 10:26:59 +01:00