[libcxx] r333435 - Mark __clear_and_shrink() as noexcept. This prevents the generation of a catch block and call to terminate in string's move assignment. Thanks to Howard for the 'catch'.

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Tue May 29 10:04:37 PDT 2018


Author: marshall
Date: Tue May 29 10:04:37 2018
New Revision: 333435

URL: http://llvm.org/viewvc/llvm-project?rev=333435&view=rev
Log:
Mark __clear_and_shrink() as noexcept. This prevents the generation of a catch block and call to terminate in string's move assignment. Thanks to Howard for the 'catch'.

Modified:
    libcxx/trunk/include/string

Modified: libcxx/trunk/include/string
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/string?rev=333435&r1=333434&r2=333435&view=diff
==============================================================================
--- libcxx/trunk/include/string (original)
+++ libcxx/trunk/include/string Tue May 29 10:04:37 2018
@@ -1259,7 +1259,7 @@ public:
 
     _LIBCPP_INLINE_VISIBILITY bool __invariants() const;
 
-    _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink();
+    _LIBCPP_INLINE_VISIBILITY void __clear_and_shrink() _NOEXCEPT;
     
     _LIBCPP_INLINE_VISIBILITY
     bool __is_long() const _NOEXCEPT
@@ -3585,7 +3585,7 @@ basic_string<_CharT, _Traits, _Allocator
 template<class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 void 
-basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink()
+basic_string<_CharT, _Traits, _Allocator>::__clear_and_shrink() _NOEXCEPT
 {
     clear();
     if(__is_long())




More information about the cfe-commits mailing list