From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15355 invoked by alias); 19 Jan 2014 20:50:20 -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 15337 invoked by uid 89); 19 Jan 2014 20:50:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wg0-f45.google.com Received: from mail-wg0-f45.google.com (HELO mail-wg0-f45.google.com) (74.125.82.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 19 Jan 2014 20:50:17 +0000 Received: by mail-wg0-f45.google.com with SMTP id n12so6176344wgh.0 for ; Sun, 19 Jan 2014 12:50:13 -0800 (PST) X-Received: by 10.180.102.42 with SMTP id fl10mr7212942wib.42.1390164613588; Sun, 19 Jan 2014 12:50:13 -0800 (PST) Received: from localhost.localdomain (arf62-1-82-237-250-248.fbx.proxad.net. [82.237.250.248]) by mx.google.com with ESMTPSA id pl7sm16968482wjc.16.2014.01.19.12.50.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 19 Jan 2014 12:50:12 -0800 (PST) Message-ID: <52DC3A82.9070004@gmail.com> Date: Sun, 19 Jan 2014 20:50:00 -0000 From: =?ISO-8859-1?Q?Fran=E7ois_Dumont?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120829 Thunderbird/15.0 MIME-Version: 1.0 To: Jonathan Wakely CC: Paolo Carlini , "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: experimental testsuite patch References: <52D6BDC7.1000803@gmail.com> <52D6C3D8.6030901@oracle.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020608010604070700040701" X-SW-Source: 2014-01/txt/msg01198.txt.bz2 This is a multi-part message in MIME format. --------------020608010604070700040701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Content-length: 1586 So here is another patch proposal with the faulty debug assertion commented for the moment. 2014-01-20 François Dumont * scripts/create_testsuite_files: Add testsuite/experimental in the list of folders to introspect for tests. * include/experimental/string_view (basic_string_view<>::operator[]): Comment _GLIBCXX_DEBUG_ASSERT, incompatible with constexpr qualifier. (basic_string_view<>::front()): Likewise. (basic_string_view<>::back()): Likewise. * testsuite/experimental/string_view/element_access/wchar_t/2.cc: Merge dg-options directives into one. * testsuite/experimental/string_view/element_access/char/2.cc: Likewise. Remove invalid experimental namespace scope on string_view_type. Tested under Linux x86_64 normal, debug modes. Ok to commit ? François On 01/15/2014 06:43 PM, Jonathan Wakely wrote: > On 15 January 2014 17:22, Paolo Carlini wrote: >> On 01/15/2014 06:17 PM, Jonathan Wakely wrote: >>> I think we decided we want functions to be constexpr in debug mode if >>> they are constexpr in normal mode. >>> >>> I think std::array has solved the same problem without losing the >>> constexpr qualifier. >> Yes, I think the only complete solution we know of is that kind of strategy. >> But IMO it could wait, for the time being we could just comment out the >> checks and add comments about that (make sure first that the various make >> check* are clean as we are approaching the release of 4.9.0) > Yes, that would be the safest option. The assertions are not essential. > --------------020608010604070700040701 Content-Type: text/x-patch; name="experimental.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="experimental.patch" Content-length: 3047 Index: include/experimental/string_view =================================================================== --- include/experimental/string_view (revision 206782) +++ include/experimental/string_view (working copy) @@ -181,7 +181,8 @@ constexpr const _CharT& operator[](size_type __pos) const { - _GLIBCXX_DEBUG_ASSERT(__pos <= this->_M_len); + // TODO: Assert to restore in a way compatible with the constexpr. + // _GLIBCXX_DEBUG_ASSERT(__pos <= this->_M_len); return *(this->_M_str + __pos); } @@ -200,14 +201,16 @@ constexpr const _CharT& front() const { - _GLIBCXX_DEBUG_ASSERT(this->_M_len > 0); + // TODO: Assert to restore in a way compatible with the constexpr. + // _GLIBCXX_DEBUG_ASSERT(this->_M_len > 0); return *this->_M_str; } constexpr const _CharT& back() const { - _GLIBCXX_DEBUG_ASSERT(this->_M_len > 0); + // TODO: Assert to restore in a way compatible with the constexpr. + // _GLIBCXX_DEBUG_ASSERT(this->_M_len > 0); return *(this->_M_str + this->_M_len - 1); } Index: scripts/create_testsuite_files =================================================================== --- scripts/create_testsuite_files (revision 206782) +++ scripts/create_testsuite_files (working copy) @@ -32,7 +32,7 @@ # This is the ugly version of "everything but the current directory". It's # what has to happen when find(1) doesn't support -mindepth, or -xtype. dlist=`echo [0-9][0-9]*` -dlist="$dlist abi backward ext performance tr1 tr2 decimal" +dlist="$dlist abi backward ext performance tr1 tr2 decimal experimental" find $dlist "(" -type f -o -type l ")" -name "*.cc" -print > $tmp.01 find $dlist "(" -type f -o -type l ")" -name "*.c" -print > $tmp.02 cat $tmp.01 $tmp.02 | sort > $tmp.1 Index: testsuite/experimental/string_view/element_access/wchar_t/2.cc =================================================================== --- testsuite/experimental/string_view/element_access/wchar_t/2.cc (revision 206782) +++ testsuite/experimental/string_view/element_access/wchar_t/2.cc (working copy) @@ -1,6 +1,5 @@ -// { dg-options "-std=gnu++1y" } // { dg-do run { xfail *-*-* } } -// { dg-options "-O0" } +// { dg-options "-std=gnu++1y -O0" } // { dg-require-debug-mode "" } // Copyright (C) 2013-2014 Free Software Foundation, Inc. Index: testsuite/experimental/string_view/element_access/char/2.cc =================================================================== --- testsuite/experimental/string_view/element_access/char/2.cc (revision 206782) +++ testsuite/experimental/string_view/element_access/char/2.cc (working copy) @@ -1,6 +1,5 @@ -// { dg-options "-std=gnu++1y" } // { dg-do run { xfail *-*-* } } -// { dg-options "-O0" } +// { dg-options "-std=gnu++1y -O0" } // { dg-require-debug-mode "" } // Copyright (C) 2013-2014 Free Software Foundation, Inc. @@ -26,6 +25,6 @@ main() { typedef std::experimental::string_view string_view_type; - experimental::string_view_type s; + string_view_type s; s[0]; // abort } --------------020608010604070700040701--