From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 180403858C83; Mon, 27 Mar 2023 17:33:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 180403858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52e.google.com with SMTP id eh3so39281925edb.11; Mon, 27 Mar 2023 10:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679938433; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1VEl7uRaUpejwo40CnnxbHs1G3bXi1b7905ysZiDN8M=; b=SDDh+AXjiobmJkIc2v+sJo60Cec0SZTnBdzXgcCxjaVU/BYtgN88OeI7SAYeeRaaN9 RRcsUpfKT4BwJx/+wttm6xsbclZXUkIH1Fg/PFcR0C7BI5JDH/VLMu+Gq6+3qDlQSEn6 wn11idwa2BQnP905+qqyp2071vztWg9G5FBVkMsgNfbik/ogC1Deue0OkKjXBE0cpIfJ 9EYF+OTuI2YG/RT7WrNYdE2X4D0il13ZINWdQ5hnDlwqOD3Z3gvQ1ha4nGm0TKYobrPd 3W0qRNKdef6Uw7npc8up0KMthrjHStoca9KclsmA26XxiETeEpGaOERLbCMr7TBRwZX3 GuiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679938433; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1VEl7uRaUpejwo40CnnxbHs1G3bXi1b7905ysZiDN8M=; b=2D1xBGYmWfBHr4Plt3McAZrtgo4YDQW2/vpc8CyQ9059qnPt6buhDKvVy1UwDANLiF 4KOGH26MoyJ7b4yRbyQlaoqNgUyZkMqSzie9ou1m8L3hPQLqFxZl97xH/ZtSCvjjSfMO 1vgkT6TJE84ESfxXJIKLx3/ACdsTYKQdRiUIyBBXd4C/ohMwMNP/vCcKWY2fQvierLQg O85SqF17ij+LQtcY9QUejSsdqM5XQxQNhFJKK7eldBbUkxIDnuyYcRsxcN0rDNMApagu VwpwHN3IiBG+TQy23/CqCuXu8lu/DEjFiMm5QcLB5hzEMPOq78fsJLEnvewmBNyPGUan D34g== X-Gm-Message-State: AAQBX9fgM6k0rSBY9ORCVnkura+rjrO9nNVevq0wvCW3HOkYVGf8Y/9I 9+ID3X0svQrQ0guBlBrOSTIF792g9oU= X-Google-Smtp-Source: AKy350Y7h71TAzD22XFHFMCPh9xhv6MuATpSmLoCkjX9ecuwwql7qFM9pSKMaVod9ynOTCcUQjFtTQ== X-Received: by 2002:aa7:cac5:0:b0:500:4a5d:af3f with SMTP id l5-20020aa7cac5000000b005004a5daf3fmr13274271edt.34.1679938432599; Mon, 27 Mar 2023 10:33:52 -0700 (PDT) Received: from [10.37.1.131] ([109.190.253.11]) by smtp.gmail.com with ESMTPSA id r17-20020a50aad1000000b005024459f431sm1551154edc.70.2023.03.27.10.33.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Mar 2023 10:33:52 -0700 (PDT) Message-ID: Date: Mon, 27 Mar 2023 19:33:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [GSoC] Conflicted Built-in Trait Name Content-Language: en-US To: Ken Matsui , libstdc++@gcc.gnu.org Cc: gcc@gcc.gnu.org References: <7f83711f-5094-6c6d-822b-966293062afc@inria.fr> From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 26/03/2023 04:01, Ken Matsui via Libstdc++ wrote: > On Sat, Mar 25, 2023 at 5:38 AM Marc Glisse wrote: >> On Sat, 25 Mar 2023, Ken Matsui via Gcc wrote: >> >>> Built-in trait naming simply adds two underscores (__) to the original >>> trait name. However, the same names are already in use for some >>> built-in traits, such as is_void, is_pointer, and is_signed. >>> >>> For example, __is_void is used in the following files: >>> >>> * gcc/testsuite/g++.dg/tm/pr46567.C >> This is a testcase, you can rename __is_void to whatever in there, it >> doesn't matter. >> >>> * libstdc++-v3/include/bits/cpp_type_traits.h >> This __is_void seems to be used in a single place in >> include/debug/helper_functions.h, couldn't we tweak that code so __is_void >> becomes unused and can be removed? > That worked. Thank you! What worked ? > > So, we can remove a code in a header as long as it is not standard and > is not used elsewhere, can't we? You can do anything you like as long as you run the testsuite before presenting your patch. Here note that you'll need to run: make check-debug to run tests in _GLIBCXX_DEBUG mode which is making use of the code in helper_functions.h. Clearly this usage of std::__is_void could be replaced with your builtin by reimplementing _Distance_traits like this:   template::__type>     struct _Distance_traits     {     private:       typedef     typename std::iterator_traits<_Iterator>::difference_type _ItDiffType;       typedef     typename std::conditional<__is_void<_ItDiffType>,                   std::ptrdiff_t, _ItDiffType>::type _DiffType;     public:       typedef std::pair<_DiffType, _Distance_precision> __type;     }; this is untested, just to give you an idea of what your patch could be. François