From patchwork Mon Oct 10 18:32:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 680530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3st7zT1cKWz9sBr for ; Tue, 11 Oct 2016 05:33:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=e4E9ehFL; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=cEl+5YL3mueFROHBrzzI6EVUDc+SJvXBHWXIAqfBQC0nDVeKgAesr W6nzczozC2lUqTmcybVMaJckVI37DYnvAFv8kRqNs2bc6ql46VIAlTtxmb1PVA0y ERo341Cx/iVACPSoNvTLW0H5Bg+5dzI3dQZQBkw7vVjTCOvz+iW+fc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=lQvaak9wIUbb1u/rewsaJeVLH7Y=; b=e4E9ehFLVmFm/nT8G5gP SWlj4YnbzDquC7oSRikR4uQv/CnNp2HSv7bQXhGzBSAD4crSyrkmkrzdH8HBFW4u TE4zBle2p7Ez1S3rHNtf3MbUiMRw6qnfKyPSX4ui+CrC4qC3ZayjmGvoT+q6Gsfb 8XBbvyGTm/tpYbSV4VGlzyQ= Received: (qmail 7293 invoked by alias); 10 Oct 2016 18:33:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7224 invoked by uid 89); 10 Oct 2016 18:33:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=*tmp, 1097 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Oct 2016 18:32:57 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DFFFC049D5C; Mon, 10 Oct 2016 18:32:56 +0000 (UTC) Received: from localhost (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9AIWtPB006024; Mon, 10 Oct 2016 14:32:56 -0400 Date: Mon, 10 Oct 2016 19:32:55 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Use noexcept instead of _GLIBCXX_USE_NOEXCEPT Message-ID: <20161010183255.GA30527@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.0 (2016-08-17) This file is compiled with -std=gnu++11 so there's no need to use the macro, we can use noexcept directly. * libsupc++/eh_ptr.cc (exception_ptr): Replace _GLIBCXX_USE_NOEXCEPT with noexcept. Tested powerpc64le-linbux, committed to trunk. commit f80e14a01697a34b835638a303967c0a7ad194a1 Author: Jonathan Wakely Date: Mon Oct 10 18:38:20 2016 +0100 Use noexcept instead of _GLIBCXX_USE_NOEXCEPT * libsupc++/eh_ptr.cc (exception_ptr): Replace _GLIBCXX_USE_NOEXCEPT with noexcept. diff --git a/libstdc++-v3/libsupc++/eh_ptr.cc b/libstdc++-v3/libsupc++/eh_ptr.cc index 3b8e0a01..f3c910b 100644 --- a/libstdc++-v3/libsupc++/eh_ptr.cc +++ b/libstdc++-v3/libsupc++/eh_ptr.cc @@ -63,33 +63,31 @@ static_assert( adjptr<__cxa_exception>() #endif } -std::__exception_ptr::exception_ptr::exception_ptr() _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::exception_ptr() noexcept : _M_exception_object(0) { } -std::__exception_ptr::exception_ptr::exception_ptr(void* obj) -_GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::exception_ptr(void* obj) noexcept : _M_exception_object(obj) { _M_addref(); } -std::__exception_ptr::exception_ptr::exception_ptr(__safe_bool) -_GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::exception_ptr(__safe_bool) noexcept : _M_exception_object(0) { } std::__exception_ptr:: -exception_ptr::exception_ptr(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT +exception_ptr::exception_ptr(const exception_ptr& other) noexcept : _M_exception_object(other._M_exception_object) { _M_addref(); } -std::__exception_ptr::exception_ptr::~exception_ptr() _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::~exception_ptr() noexcept { _M_release(); } std::__exception_ptr::exception_ptr& std::__exception_ptr:: -exception_ptr::operator=(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT +exception_ptr::operator=(const exception_ptr& other) noexcept { exception_ptr(other).swap(*this); return *this; @@ -97,7 +95,7 @@ exception_ptr::operator=(const exception_ptr& other) _GLIBCXX_USE_NOEXCEPT void -std::__exception_ptr::exception_ptr::_M_addref() _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::_M_addref() noexcept { if (_M_exception_object) { @@ -109,7 +107,7 @@ std::__exception_ptr::exception_ptr::_M_addref() _GLIBCXX_USE_NOEXCEPT void -std::__exception_ptr::exception_ptr::_M_release() _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::_M_release() noexcept { if (_M_exception_object) { @@ -128,13 +126,12 @@ std::__exception_ptr::exception_ptr::_M_release() _GLIBCXX_USE_NOEXCEPT void* -std::__exception_ptr::exception_ptr::_M_get() const _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::_M_get() const noexcept { return _M_exception_object; } void -std::__exception_ptr::exception_ptr::swap(exception_ptr &other) - _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::swap(exception_ptr &other) noexcept { void *tmp = _M_exception_object; _M_exception_object = other._M_exception_object; @@ -144,27 +141,24 @@ std::__exception_ptr::exception_ptr::swap(exception_ptr &other) // Retained for compatibility with CXXABI_1.3. void -std::__exception_ptr::exception_ptr::_M_safe_bool_dummy() - _GLIBCXX_USE_NOEXCEPT { } +std::__exception_ptr::exception_ptr::_M_safe_bool_dummy() noexcept { } // Retained for compatibility with CXXABI_1.3. bool -std::__exception_ptr::exception_ptr::operator!() const _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::operator!() const noexcept { return _M_exception_object == 0; } // Retained for compatibility with CXXABI_1.3. -std::__exception_ptr::exception_ptr::operator __safe_bool() const -_GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::operator __safe_bool() const noexcept { return _M_exception_object ? &exception_ptr::_M_safe_bool_dummy : 0; } const std::type_info* -std::__exception_ptr::exception_ptr::__cxa_exception_type() const - _GLIBCXX_USE_NOEXCEPT +std::__exception_ptr::exception_ptr::__cxa_exception_type() const noexcept { __cxa_exception *eh = __get_exception_header_from_obj (_M_exception_object); return eh->exceptionType; @@ -172,19 +166,17 @@ std::__exception_ptr::exception_ptr::__cxa_exception_type() const bool std::__exception_ptr::operator==(const exception_ptr& lhs, - const exception_ptr& rhs) - _GLIBCXX_USE_NOEXCEPT + const exception_ptr& rhs) noexcept { return lhs._M_exception_object == rhs._M_exception_object; } bool std::__exception_ptr::operator!=(const exception_ptr& lhs, - const exception_ptr& rhs) - _GLIBCXX_USE_NOEXCEPT + const exception_ptr& rhs) noexcept { return !(lhs == rhs);} std::exception_ptr -std::current_exception() _GLIBCXX_USE_NOEXCEPT +std::current_exception() noexcept { __cxa_eh_globals *globals = __cxa_get_globals (); __cxa_exception *header = globals->caughtExceptions;