]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix build of nptl/tst-thread_local1.cc with GCC 12
authorJoseph Myers <joseph@codesourcery.com>
Mon, 2 Aug 2021 16:33:44 +0000 (16:33 +0000)
committerFangrui Song <maskray@google.com>
Thu, 27 Oct 2022 18:29:56 +0000 (11:29 -0700)
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.

(cherry picked from commit 2ee9b24f47db8d0a8d0ccadb999335a1d4cfc364)

nptl/tst-thread_local1.cc

index 0cfdcd6d195c4877e91f2da4e8a7e04393d9be9e..5f4cf5cc3b7c509f3e36d16aa4e7b3dbe96fd19f 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <array>
 #include <functional>
 #include <string>
 #include <thread>