diff mbox series

[committed] libstdc++: Add missing noexcept on std::thread member function [PR 100298]

Message ID YIlNZIpBd9nal1Av@redhat.com
State New
Headers show
Series [committed] libstdc++: Add missing noexcept on std::thread member function [PR 100298] | expand

Commit Message

Jonathan Wakely April 28, 2021, 11:56 a.m. UTC
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.

Tested x86_64-linux. Committed to trunk, about to backport to gcc-11.
commit 5cc28000cfcc219fb4c45dbc5388ec05109049af
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Apr 28 12:45:49 2021

    libstdc++: Add missing noexcept on std::thread member function [PR 100298]
    
    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.
diff mbox series

Patch

diff --git a/libstdc++-v3/include/bits/std_thread.h b/libstdc++-v3/include/bits/std_thread.h
index 70cb31a5331..2a500bf1777 100644
--- a/libstdc++-v3/include/bits/std_thread.h
+++ b/libstdc++-v3/include/bits/std_thread.h
@@ -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