From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79518 invoked by alias); 26 Apr 2017 10:33:03 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 79493 invoked by uid 89); 26 Apr 2017 10:33:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=evidently, HX-detected-operating-system:2.4.x-2.6.x, Hx-languages-length:1036, our X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Apr 2017 10:33:01 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46093) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d3KFp-0004Z1-QF for gcc@gnu.org; Wed, 26 Apr 2017 06:33:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3KFk-0006Ou-G2 for gcc@gnu.org; Wed, 26 Apr 2017 06:33:01 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:47239) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3KFk-0006Kc-85 for gcc@gnu.org; Wed, 26 Apr 2017 06:32:56 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v3QAWlNn026730 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Apr 2017 10:32:47 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v3QAWlf7018594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 26 Apr 2017 10:32:47 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v3QAWf7g003333; Wed, 26 Apr 2017 10:32:42 GMT Received: from [192.168.1.4] (/87.20.193.125) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Apr 2017 03:32:41 -0700 To: "gcc@gnu.org" Cc: Jason Merrill , Adam Butcher From: Paolo Carlini Subject: [C++, concepts] Two slightly obscure pt.c functions? Message-ID: <5859ec12-a027-c944-57a4-7c49320429c6@oracle.com> Date: Wed, 26 Apr 2017 10:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 141.146.126.69 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00127.txt.bz2 Hi, in 2013 (2013-09-16) Adam added two slightly obscure functions and I can't find much around in terms of rationale, etc: /* Returns true iff TYPE is a TEMPLATE_TYPE_PARM representing 'auto', 'decltype(auto)' or a concept. */ bool is_auto_or_concept (const_tree type) { return is_auto (type); // or concept } /* Returns the TEMPLATE_TYPE_PARM in TYPE representing a generic type (`auto' or a concept identifier) iff TYPE contains a use of a generic type. Returns NULL_TREE otherwise. */ tree type_uses_auto_or_concept (tree type) { return find_type_usage (type, is_auto_or_concept); } The latter seems completely unused (it's meant for debugging purposes?); the former evidently simply forwards to is_auto, and we end up in the front-end with uses of both, which in fact are equivalent, which seems weird: IMHO, if they are actually equivalent in our implementation we should clearly explain that in the comment and have only one. Or what? Thanks for any feedback, Paolo.