gcc/libstdc++-v3/testsuite/21_strings/basic_string
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
..
allocator
capacity
cons libstdc++: Suppress -Wstringop-overread warning in test 2021-06-18 11:16:58 +01:00
debug
element_access
hash libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
inserters_extractors
literals
modifiers libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
numeric_conversions
operations libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
operators libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
range_access
requirements libstdc++: Fix and complete __gnu_debug::basic_string implementation 2021-03-25 21:56:14 +01:00
types libstdc++: Remove redundant -std=gnu++17 option from PMR tests 2021-05-11 20:50:08 +01:00
40160.cc
56166.cc
79162.cc libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
dr2268.cc
erasure.cc
init-list.cc
lwg2758.cc libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
lwg2946.cc libstdc++: Remove redundant -std=gnu++17 option from strings tests 2021-05-11 20:50:08 +01:00
pthread4.cc
pthread18185.cc
pthread33394.cc