This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Use noexcept instead of _GLIBCXX_NOEXCEPT
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 2 Oct 2015 23:12:44 +0100
- Subject: [patch] Use noexcept instead of _GLIBCXX_NOEXCEPT
- Authentication-results: sourceware.org; auth=none
There's no need to use the _GLIBCXX_NOEXCEPT macro in code that is
only compiled when __cplusplus >= 201103L, just use noexcept directly.
Tested powerpc64le-linux (both ABIs), committed to trunk.
commit 5c1cf3fcbfa60abf8d8a174336982a548e23c64e
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Oct 2 22:55:39 2015 +0100
Use noexcept instead of _GLIBCXX_NOEXCEPT
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::front() const, basic_string::back() const): Use
noexcept instead of _GLIBCXX_NOEXCEPT macro.
(__versa_string::front, __versa_string::back): Likewise.
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index c1689af..35246d9 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -3441,7 +3441,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
* element of the %string.
*/
const_reference
- front() const _GLIBCXX_NOEXCEPT
+ front() const noexcept
{
__glibcxx_assert(!empty());
return operator[](0);
@@ -3463,7 +3463,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
* last element of the %string.
*/
const_reference
- back() const _GLIBCXX_NOEXCEPT
+ back() const noexcept
{
__glibcxx_assert(!empty());
return operator[](this->size() - 1);
diff --git a/libstdc++-v3/include/ext/vstring.h b/libstdc++-v3/include/ext/vstring.h
index 94af25e..68acd57 100644
--- a/libstdc++-v3/include/ext/vstring.h
+++ b/libstdc++-v3/include/ext/vstring.h
@@ -613,7 +613,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* element of the %string.
*/
reference
- front() _GLIBCXX_NOEXCEPT
+ front() noexcept
{ return operator[](0); }
/**
@@ -621,7 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* element of the %string.
*/
const_reference
- front() const _GLIBCXX_NOEXCEPT
+ front() const noexcept
{ return operator[](0); }
/**
@@ -629,7 +629,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* element of the %string.
*/
reference
- back() _GLIBCXX_NOEXCEPT
+ back() noexcept
{ return operator[](this->size() - 1); }
/**
@@ -637,7 +637,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* last element of the %string.
*/
const_reference
- back() const _GLIBCXX_NOEXCEPT
+ back() const noexcept
{ return operator[](this->size() - 1); }
#endif