From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61325 invoked by alias); 13 Nov 2015 23:53:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 61304 invoked by uid 89); 13 Nov 2015 23:53:47 -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 X-HELO: mail-lb0-f172.google.com Received: from mail-lb0-f172.google.com (HELO mail-lb0-f172.google.com) (209.85.217.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 13 Nov 2015 23:53:37 +0000 Received: by lbbkw15 with SMTP id kw15so62626855lbb.0 for ; Fri, 13 Nov 2015 15:53:33 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.200.229 with SMTP id jv5mr11768580lbc.23.1447458813712; Fri, 13 Nov 2015 15:53:33 -0800 (PST) Received: by 10.114.71.114 with HTTP; Fri, 13 Nov 2015 15:53:33 -0800 (PST) In-Reply-To: References: Date: Fri, 13 Nov 2015 23:53:00 -0000 Message-ID: Subject: Re: [PATCH] 21_strings/basic_string/capacity/wchar_t/18654.cc From: David Edelsohn To: Jonathan Wakely , Paolo Carlini Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-11/txt/msg01791.txt.bz2 On Fri, Nov 13, 2015 at 1:40 PM, David Edelsohn wrote: > http://www.cplusplus.com/reference/string/basic_string/reserve/ > > "Note that the resulting string capacity may be equal or greater than n." > > The current testcase verifies that the capacity is exactly equal to > the length of the string or reserve value, but the standard allows the > capacity to be larger. On AIX, the capacity is larger and the > testcase incorrectly fails. > > Linux x86-64: > i: 4 > str.length: 4 > str.capacity: 4 > str.capacity: 12 > str.capacity: 8 > str.capacity: 4 > > AIX: > i: 4 > str.length: 4 > str.capacity: 7 <-- i > str.capacity: 14 <-- i*3 > str.capacity: 8 <-- i*2 > str.capacity: 7 <-- default > > * 21_strings/basic_string/capacity/wchar_t/18654.cc: Verify the Jonathan, AIX has 2-byte wchar_t in 32 bit mode, which seems to be the cause of all of the libstdc++ testsuite wchar_t failures. If GCC libstdc++ is suppose to shrink-to-fit, how should the testcases be fixed? Thanks, David