From patchwork Thu Jun 23 20:22:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 639884 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 3rbCZj7598z9sp7 for ; Fri, 24 Jun 2016 06:23:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=i7esYSSq; 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:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=HvdAL4NtxdsYRHboXT8RVqJMRnFYcKSyIgchR9d8zeVRKFNMzOVUt kzv2a6S9sX7D3ZcyI7QiOU0Xc+9YEQipN2m4dpme5s3X/157OUGmE8i/CAi9pLar qaHlZScXTF7wfOjKod2+2W1T3z/IqWXCCjD3t1gqu1pp96oZjPbuME= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=EDM2brOfJLjdU/tHbPwVUNhWpTk=; b=i7esYSSqeJKlGUligvMr 0wtSockW9C7P3ErP8TQCzm2gj9o/ey3Zpp2Mdo4idjwXN4O8znbt+1qMkDw5ir2V 84+kbLV3ifDzSd5KG2uv3mJUYto9i5abOgNB6m53f5rso6Ukt41hccntibsR/Mz/ GBkXdZoGS4mxzXJDAx9lBHQ= Received: (qmail 85789 invoked by alias); 23 Jun 2016 20:22:58 -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 85766 invoked by uid 89); 23 Jun 2016 20:22:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=_tp, _Tp, 867 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 23 Jun 2016 20:22:36 +0000 Received: by mail-wm0-f52.google.com with SMTP id a66so65032446wme.0; Thu, 23 Jun 2016 13:22:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version; bh=UxdhBjKnpGCVNLXyX3RT/me4x8Eyw1HQfpAh+3oE7EE=; b=e6tf9/YWSZotFALYke9ZJZzKDuFb0nxWXd+PRzYg9dMm9yXmj+GExnh/n+bXAmd/fn IrfG1gHruQKCziC/aTcerPtje7bI3VCSPJ2Y/2goreO/8ULe7PfhQVWAo2U84qxEqnq3 vEfFoZX5PBiXi6W5RqCyKR4PlyuTiU4oirAcgUeEELojhNSQHgdC74erRoqtt4oYFhg1 Ph4k4DoOx3o1Y3QjrjDBuEOnoqZd9PTHGEnuretT/td0t3SrctxyFsgqCtNjHxYwHpR/ 7VAIM6SIVCZYwwyLil+LF3hbqSIsbWg4wJSpP6QAB9zKalPFvflxSqWJY33atmP98gn5 bh+g== X-Gm-Message-State: ALyK8tJyJSYy3rwU04++gI5rv3RbyDQ06timUD4f4OsZRMJJxswP6McvsKweDKwXStAEaw== X-Received: by 10.194.248.230 with SMTP id yp6mr302016wjc.144.1466713335721; Thu, 23 Jun 2016 13:22:15 -0700 (PDT) Received: from [192.168.0.22] (arf62-1-82-237-250-248.fbx.proxad.net. [82.237.250.248]) by smtp.googlemail.com with ESMTPSA id xs9sm1693991wjc.11.2016.06.23.13.22.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 13:22:14 -0700 (PDT) From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Subject: Fix zero size debug array swap noexcept qualification To: "libstdc++@gcc.gnu.org" , gcc-patches Message-ID: <576C44F6.608@gmail.com> Date: Thu, 23 Jun 2016 22:22:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Debug mode array had simply been forgotten when fixing zero-size swap method as part of swappable traits implementation. * include/debug/array (array<>::swap): Fix noexcept qualificaton for zero-size array. Tested under Linux x86_64 debug mode. François Index: include/debug/array =================================================================== --- include/debug/array (revision 237614) +++ include/debug/array (working copy) @@ -86,7 +86,7 @@ void swap(array& __other) - noexcept(__is_nothrow_swappable<_Tp>::value) + noexcept(_AT_Type::_Is_nothrow_swappable::value) { std::swap_ranges(begin(), end(), __other.begin()); } // Iterators. @@ -168,9 +168,8 @@ at(size_type __n) { if (__n >= _Nm) - std::__throw_out_of_range_fmt(__N("array::at: __n " - "(which is %zu) >= _Nm " - "(which is %zu)"), + std::__throw_out_of_range_fmt(__N("array::at: __n (which is %zu) " + ">= _Nm (which is %zu)"), __n, _Nm); return _AT_Type::_S_ref(_M_elems, __n); }