From patchwork Tue Apr 15 18:29:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 339353 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 E6D5E140099 for ; Wed, 16 Apr 2014 04:29:22 +1000 (EST) 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=XVJCUi6xR8b7uFYHWv5yiXz7SRDufx3e5I4eLX1B8WO0Dj5IwfT/D ciwgxnjQLxRUMP1/sM453RJYpSGlm54+lLwtEfO4HJ7rwsz9/qtx+y0RmgV4pDCl jrwUsY6wGfnL/4nm4JQmVY8gBzzvGXGWoIlr31f/zm9IVhkzY+VtKc= 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=n4hQmj9wlo4FcawDDE2GDWLLnzI=; b=PJszAq9c63ux2Am3wp3a dHVBc3gaQubJ4TLFAHSebfvI4ccixRcgWm8pC79Y0btn5/JAinq8d/YRtOAVuEUI kPx4W69v/EVAOFWzGl5lWGhMdXIxKhkHztBxi3CYEBDp3qtUyRRqrqoShVnyi9F9 /jxV+g2cpwUpKm3HrqAtffk= Received: (qmail 9708 invoked by alias); 15 Apr 2014 18:29:14 -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 9687 invoked by uid 89); 15 Apr 2014 18:29:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 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; Tue, 15 Apr 2014 18:29:13 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3FITCYx027710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Apr 2014 14:29:12 -0400 Received: from localhost (vpn1-4-89.ams2.redhat.com [10.36.4.89]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3FITBsP022596; Tue, 15 Apr 2014 14:29:11 -0400 Date: Tue, 15 Apr 2014 19:29:10 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Add const to constexpr member functions Message-ID: <20140415182910.GO6807@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Add const to functions that would change meaning in C++14. Tested x86_64-linux, committed to trunk. commit f30d35d5a7aa3ff2e0d0e4010aecaf9f5a5fb9ed Author: Jonathan Wakely Date: Tue Apr 15 18:55:45 2014 +0100 * include/bits/atomic_base.h (__atomic_base<_PTp*>::_M_type_size): Add const to constexpr member functions. diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 242459a..1fc0ebb 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -675,10 +675,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Factored out to facilitate explicit specialization. constexpr ptrdiff_t - _M_type_size(ptrdiff_t __d) { return __d * sizeof(_PTp); } + _M_type_size(ptrdiff_t __d) const { return __d * sizeof(_PTp); } constexpr ptrdiff_t - _M_type_size(ptrdiff_t __d) volatile { return __d * sizeof(_PTp); } + _M_type_size(ptrdiff_t __d) const volatile { return __d * sizeof(_PTp); } public: __atomic_base() noexcept = default;