From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 469523857827 for ; Fri, 13 Aug 2021 17:10:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 469523857827 Received: by mail-wm1-x32e.google.com with SMTP id i10-20020a05600c354ab029025a0f317abfso10125961wmq.3 for ; Fri, 13 Aug 2021 10:10:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=GuwPDWCvEnSQh+hw+A5xqErjlIO2XGLmRA/JkFZBWrQ=; b=kMWo3rFNFaUmYG0TD37RBq0c20EP3txpQOQDoC/m8dZ0KEf3jRVFglnOVBBmZueE+j rVs7mPfxsrhK8JZxqeJoGKe6L/+jrZ+PzeU80p9hPGGQUVLsg5IKNWLgLR/JxuSNOkkN ONtnhX95KHPoA/QODxZBxqbFHPEU1FLfynPRM0hlFQYU2rfEvn2nxisczQlrI+nKBdt+ I7zD/OfrMqcw4W7S9ZkBdpG+mcDwsg8W/Homc27appVxrEjOq6GzwecKLi9JQAUpc039 SGvk9jxS/irtSCmNXj4/2gQURS8iwm5c87IGDJs2RRYZL/3qpVLo9YQasfOLXYLRRvwd uYPw== X-Gm-Message-State: AOAM530+nwPPDGhTiymdIMOJamYHMFfIDr5z0Po+iy2M4orVMItcVzdH TJRa1ioMkJcrl1KTSMrCU9SeIjb27FQ= X-Google-Smtp-Source: ABdhPJz0tsaJz+br0MLbyY9nARVlq4zG7Z2sj4cT4jiiow5undWdAuvtgBGNQW22wEpRcFPOO5ykcg== X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr3676891wmq.101.1628874599660; Fri, 13 Aug 2021 10:09:59 -0700 (PDT) Received: from ?IPv6:2a01:e0a:1dc:b1c0:5c:4284:6a47:ef93? ([2a01:e0a:1dc:b1c0:5c:4284:6a47:ef93]) by smtp.googlemail.com with ESMTPSA id s10sm2570091wrv.54.2021.08.13.10.09.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Aug 2021 10:09:59 -0700 (PDT) Subject: Re: [PATCH] Improvements to valid range checks in debug mode To: libstdc++@gcc.gnu.org References: <20200227130636.GV9441@redhat.com> From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= Message-ID: Date: Fri, 13 Aug 2021 19:09:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20200227130636.GV9441@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 13 Aug 2021 17:10:02 -0000 I just come back to this email and it sounds like the right moment to commit it. On 27/02/20 2:06 pm, Jonathan Wakely wrote: > These should wait for stage 1 but I'm posting them now for comment. > > With the change to __gnu_debug::__valid_range we now get a debug > assertion for: > >   std::string s; >   std::min_element(std::string::iterator{}, s.end()); > > where previously it would just crash with undefined behaviour. >