]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Add missing noexcept on std::thread member function [PR 100298]
authorJonathan Wakely <jwakely@redhat.com>
Wed, 28 Apr 2021 11:45:49 +0000 (12:45 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 28 Apr 2021 11:56:31 +0000 (12:56 +0100)
The new inline definition of std::thread::hardware_concurrency() for
non-gthreads targets is missing the noexcept-specifier that is on the
declaration.

libstdc++-v3/ChangeLog:

PR libstdc++/100298
* include/bits/std_thread.h (thread::hardware_concurrency): Add
missing noexcept to inline definition for non-gthreads targets.

(cherry picked from commit 5cc28000cfcc219fb4c45dbc5388ec05109049af)

libstdc++-v3/include/bits/std_thread.h

index 70cb31a5331538ce5c7d531293be4e2f9d2cc48a..2a500bf177728fadc7d39eb30253b4f5d0e12589 100644 (file)
@@ -270,7 +270,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 #ifndef _GLIBCXX_HAS_GTHREADS
   inline void thread::join() { std::__throw_system_error(EINVAL); }
   inline void thread::detach() { std::__throw_system_error(EINVAL); }
-  inline unsigned int thread::hardware_concurrency() { return 0; }
+  inline unsigned int thread::hardware_concurrency() noexcept { return 0; }
 #endif
 
   inline void