From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-00641c01.pphosted.com (mx0a-00641c01.pphosted.com [205.220.165.146]) by sourceware.org (Postfix) with ESMTPS id 255773858C5F for ; Wed, 7 Feb 2024 21:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 255773858C5F Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=cs.washington.edu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 255773858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.220.165.146 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707343143; cv=none; b=NwNcVS8YOvf/v/OIj7jB4RucRqwcPJca5UemwEFMZbJCvajhiuAEQJyb6QFzsCLbwTe7lfqkE/2thM/oSOIBYirKEhvs/B7HR2l43oYTX3MyNOTPWoCm3eae0YIZlyZZBgNMuuV/ilxBRpn9FxagvNOzdlIJCIfljKSs2RZoImc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707343143; c=relaxed/simple; bh=IsEys3/ewcYL1EeUBBAQNN74iO/IjamBBrrhCNf2img=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=DGbrVGBM+MqmoioX5K93wdytcF/gr447X64+yNCkAT8908iandBEvvI9ySYJsr2ffsfOZCnhWqlQtbcEf+TNLim4VCo+LJaOhwK+W2toeBq5A5IlW1inF3oC3xcdKvGqAJrTpdGAypuJsY+7bAjSFLQjP9djKC/TW5rmU8Webxo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0247470.ppops.net [127.0.0.1]) by mx0a-00641c01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 417Lwhpw030498 for ; Wed, 7 Feb 2024 21:59:00 GMT Received: from mxout26.s.uw.edu (mxout26.s.uw.edu [140.142.234.176]) by mx0a-00641c01.pphosted.com (PPS) with ESMTPS id 3w4fm49trd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Feb 2024 21:58:59 +0000 Received: from smtp.washington.edu (smtp.washington.edu [128.208.60.132]) by mxout26.s.uw.edu (8.14.4+UW20.07/8.14.4+UW24.02) with ESMTP id 417LwXTe017716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 7 Feb 2024 13:58:33 -0800 X-Auth-Received: from Kens-MacBook-Pro-4.local ([10.19.240.75]) (authenticated authid=kmatsui@cs.washington.edu) by smtp.washington.edu (8.16.1+UW21.10/8.14.4+UW24.02) with ESMTPSA id 417LwX0f010171 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 7 Feb 2024 13:58:33 -0800 X-UW-Orig-Sender: kmatsui@smtp.washington.edu Date: Wed, 7 Feb 2024 13:58:33 -0800 From: Ken Matsui To: libstdc++@gcc.gnu.org Subject: Question about _GLIBCXX_HAVE_BUILTIN_IS_SAME Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Proofpoint-ORIG-GUID: zvpD0OLnl367cMm12-QT2QwLSfZozGcW X-Proofpoint-GUID: zvpD0OLnl367cMm12-QT2QwLSfZozGcW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-07_09,2024-02-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 malwarescore=0 mlxlogscore=800 spamscore=0 priorityscore=1501 impostorscore=0 clxscore=1031 suspectscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402070163 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE 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: Hi, I found we are using _GLIBCXX_HAVE_BUILTIN_IS_SAME in type_traits, but I think we can use _GLIBCXX_USE_BUILTIN_TRAIT(__is_same) instead. I feel this is a bit more readable and consistent with other traits. With this change, AFAIK, _GLIBCXX_HAVE_BUILTIN_IS_SAME is not used anywhere, but can we completely remove it from gcc/libstdc++-v3/include/bits/c++config or is there any reason to keep it? /// is_same +#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same) template struct is_same -#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME : public __bool_constant<__is_same(_Tp, _Up)> + { }; #else + template + struct is_same : public false_type -#endif { }; -#ifndef _GLIBCXX_HAVE_BUILTIN_IS_SAME template struct is_same<_Tp, _Tp> : public true_type { }; #endif I am also wondering if we could replace other _GLIBCXX_HAVE_BUILTIN_* macros with _GLIBCXX_USE_BUILTIN_TRAIT(*): * _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP * _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE * _GLIBCXX_HAVE_BUILTIN_LAUNDER -- Ken Matsui