From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 1E128388CC12 for ; Fri, 11 Dec 2020 10:29:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E128388CC12 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-547-E5Q_FZ17P4ukAWBrOv3QJw-1; Fri, 11 Dec 2020 05:29:26 -0500 X-MC-Unique: E5Q_FZ17P4ukAWBrOv3QJw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8311A10CE7BB; Fri, 11 Dec 2020 10:29:24 +0000 (UTC) Received: from localhost (unknown [10.33.36.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B1EA5D71F; Fri, 11 Dec 2020 10:29:23 +0000 (UTC) Date: Fri, 11 Dec 2020 10:29:23 +0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [PATCH] Complete _GLIBCXX_DEBUG constexpr compatibility Message-ID: <20201211102923.GE2309743@redhat.com> References: <3dfe6dda-329b-2ee8-ecdb-2c1c147044f7@gmail.com> MIME-Version: 1.0 In-Reply-To: <3dfe6dda-329b-2ee8-ecdb-2c1c147044f7@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2020 10:29:30 -0000 On 11/12/20 08:20 +0100, François Dumont via Libstdc++ wrote: >Hi > >I'd like to commit this small fix to complete _GLIBCXX_DEBUG constexpr >compatibility. There are still 2 macros not using __glibcxx_assert_1. > >It fixes the generated diagnostic to have the __failed_assertion >rather than a message saying that _Error_formatter::_M_error is not >constexpr. > >    libstdc++: Fix _GLIBCXX_DEBUG mode constexpr compatibility > >    The __glibcxx_check_can_[increment|decrement]_range macros are >using the >    _GLIBCXX_DEBUG_VERIFY_COND_AT macro which is not constexpr >compliant and will produce nasty >    diagnostics rather than the std::__failed_assertion dedicated to >constexpr. Replace it with >    correct _GLIBCXX_DEBUG_VERIFY_AT_F. > >    libstdc++-v3/ChangeLog: >            * include/debug/macros.h >(__glibcxx_check_can_increment_range): Replace >            _GLIBCXX_DEBUG_VERIFY_COND_AT usage with >_GLIBCXX_DEBUG_VERIFY_AT_F. >            (__glibcxx_check_can_decrement_range): Likewise. >            * testsuite/25_algorithms/copy_backward/constexpr.cc >(test03): New. >            * testsuite/25_algorithms/copy/debug/constexpr_neg.cc: New >test. >            * >testsuite/25_algorithms/copy_backward/debug/constexpr_neg.cc: New >test. >            * testsuite/25_algorithms/equal/constexpr_neg.cc: New test. >            * testsuite/25_algorithms/equal/debug/constexpr_neg.cc: >New test. > >Tested under Linux x86_64 normal and debug modes. > >Ok to commit ? OK, thanks. Please also test with RUNTESTFLAGS=--target_board=unix/-std=gnu++11 just to be sure, but I don't think these macros are used in any code that is constexpr in C++11.