libstdc++: Fix test that fails on Solaris [PR104731]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 6 May 2022 13:31:06 +0000 (14:31 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 9 May 2022 11:28:27 +0000 (12:28 +0100)
commitdf8e384d5f91076f35852baed0974793b37ec313
tree1622c947c3ed72e140406769ba165ddd6af6ea8f
parent197b7ace534e67ee2456149dcd03856483b4ecdb
libstdc++: Fix test that fails on Solaris [PR104731]

On Solaris the dirent::d_name member is a single char, causing this test
to fail with warnings about buffer overflow. Change the test to use a
union with additional space for writing a string to the d_name member.

libstdc++-v3/ChangeLog:

PR libstdc++/104731
* testsuite/27_io/filesystem/iterators/error_reporting.cc:
Use a trailing char array as storage for dirent::d_name.

(cherry picked from commit aa8bdfee1db818b9a56908ab0197ff02c54bf281)
libstdc++-v3/testsuite/27_io/filesystem/iterators/error_reporting.cc