From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by sourceware.org (Postfix) with ESMTPS id 1E9DC389500B for ; Tue, 19 May 2020 11:32:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E9DC389500B Received: by mail-il1-x136.google.com with SMTP id m6so874389ilq.7 for ; Tue, 19 May 2020 04:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b1DgCQG+ty8aVQLeVg6L0/oDh+tXp7JV2kTOipvM0Qs=; b=EFdKg5Wy98bmAqea/B23GCs1XgzWXVLN4VUDa5xeAkGzLhlYJyljiDQMY4j9QJctA5 27jDIopNJtZ+lyyX1NBBdZRaVxdGGX86os5vW8VYWNNpuPAmoK4Q6FYqE2ulI3gewTT2 y7xFT5lruXcWg9VWwvW2oseKL6egGgCLp71AF44cGsvjthDkyWQbf6IcSqp5SSDQ/awt lUL0kq7hWYfX22orFz9yPXtnpJT3r62hXGS6NbMWLw64vCvG25qshJUHQDH9nL644IS7 nuargbMiO8KkgmDDOrAgvYsr1WNAP4KNHZnIHBsaHxoLBxR/OhA5BnCN70vfQNqEYVM3 qYMQ== X-Gm-Message-State: AOAM530LEe7Gpji7gMSXTH0fb98XRSBxqTnzWZ0P8QZNa1e46VRJwtAP wSnB46PUWde7RhUm0X/NHsIeYWBi80/ttqoctSw= X-Google-Smtp-Source: ABdhPJx8zSVFWIi+he4knuwBPb7MgA1A/J7H1IgvoQ+ZdAOTQ9FwjWEeJ4HP+5NTm7LGSsspK2QiMhT/9UPmN8ZBO0Q= X-Received: by 2002:a92:150b:: with SMTP id v11mr21598655ilk.261.1589887928454; Tue, 19 May 2020 04:32:08 -0700 (PDT) MIME-Version: 1.0 References: <12029271589797822@iva7-8a22bc446c12.qloud-c.yandex.net> <3ba570d4-e88b-3ece-d00a-771f8f8e7207@gmail.com> <87imgsi3o3.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87imgsi3o3.fsf@oldenburg2.str.redhat.com> From: Jonathan Wakely Date: Tue, 19 May 2020 12:31:57 +0100 Message-ID: Subject: Re: Invalid use of 'void' To: Florian Weimer Cc: Jonathan Wakely via Gcc-help , =?UTF-8?B?0JjQs9C+0YDRjCDQk9C+0YDQu9C+0LI=?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 11:32:10 -0000 On Tue, 19 May 2020 at 12:07, Florian Weimer wrote: > > * Jonathan Wakely via Gcc-help: > > > And G++ does allow arithmetic involving a void* and an integer, e.g. > > p1 - 32 or p2 + 64, it doesn't allow subtracting one void* from the > > other. So the extension is only partially supported for C++. We should > > probably document that. > > And it's a regression, GCC 2.7.2.3 can compile it, but GCC 2.95.2 > cannot. (Of course, I'm only half-serious here.) > > The problem I see with such extensions in C++ is that they could alter > SFINAE outcomes. But maybe that's less important these days because > people don't write custom type traits anymore. Most such extensions are disabled in SFINAE contexts: template auto f(T* p) -> decltype(p+1) { return p + 1; } int main() { void* p = nullptr; p = p + 1; // warning f(p); // error }