Fix build of nptl/tst-thread_local1.cc with GCC 12
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
The test nptl/tst-thread_local1.cc fails to build with GCC mainline
because of changes to what libstdc++ headers implicitly include what
other headers:
tst-thread_local1.cc: In function 'int do_test()':
tst-thread_local1.cc:177:5: error: variable 'std::array<std::pair<const char*, std::function<void(void* (*)(void*))> >, 2> do_thread_X' has initializer but incomplete type
177 | do_thread_X
| ^~~~~~~~~~~
Fix this by adding an explicit include of <array>.
Tested with build-many-glibcs.py for aarch64-linux-gnu.
Comments
* Joseph Myers:
> The test nptl/tst-thread_local1.cc fails to build with GCC mainline
> because of changes to what libstdc++ headers implicitly include what
> other headers:
>
> tst-thread_local1.cc: In function 'int do_test()':
> tst-thread_local1.cc:177:5: error: variable 'std::array<std::pair<const char*, std::function<void(void* (*)(void*))> >, 2> do_thread_X' has initializer but incomplete type
> 177 | do_thread_X
> | ^~~~~~~~~~~
>
> Fix this by adding an explicit include of <array>.
>
> Tested with build-many-glibcs.py for aarch64-linux-gnu.
>
> diff --git a/nptl/tst-thread_local1.cc b/nptl/tst-thread_local1.cc
> index 9608afa..338aafe 100644
> --- a/nptl/tst-thread_local1.cc
> +++ b/nptl/tst-thread_local1.cc
> @@ -21,6 +21,7 @@
> #include <stdio.h>
> #include <string.h>
>
> +#include <array>
> #include <functional>
> #include <string>
> #include <thread>
Okay, thanks.
Florian
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <string.h>
+#include <array>
#include <functional>
#include <string>
#include <thread>