From patchwork Fri Jul 23 10:45:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1509125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=F6wwB3Y8; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GWQy136lqz9sS8 for ; Fri, 23 Jul 2021 20:47:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29D9039A842E for ; Fri, 23 Jul 2021 10:47:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29D9039A842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1627037254; bh=GI7dHd0hVZAXJuo3cTMGRvpLsx6Tg8EUMIKM6PdxHOw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=F6wwB3Y8i/ub61bTkkuzHgSHVFihMc3WpED5pLa16AYovNMh7ud0qBoGENmuwOP4G cX6XSsnHAa1c2S7dTHK0HhPW2wWkraFa5yookWHBWNgCEwvhIjVpAZAPoFu+Rbcf1T mxXwKEIYVqhs4X+JTCII6xUA0uUxHHrCHjdTyBPY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 0D99739A841A for ; Fri, 23 Jul 2021 10:45:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D99739A841A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-220-uhiepM3FPQ2AC7EZgs3rjg-1; Fri, 23 Jul 2021 06:45:27 -0400 X-MC-Unique: uhiepM3FPQ2AC7EZgs3rjg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E0E392502; Fri, 23 Jul 2021 10:45:26 +0000 (UTC) Received: from localhost (unknown [10.33.36.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD3F560862; Fri, 23 Jul 2021 10:45:25 +0000 (UTC) Date: Fri, 23 Jul 2021 11:45:24 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Update documentation comments for namespace rel_ops Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The comments in describe problems that were solved years ago (for GCC 3.1). The comparison operators in are no longer ambiguous with the rel_ops ones, so the linked mailing list thread and FAQ entry aren't relevant now. The reference to std_utility.h is also outdated as it's just called utility now, both in the source tree and when installed. The use of rel_ops is still frowned upon though, so replace the discussion of ambiguities within libstdc++ headers with adminition about using rel_ops in user code. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_relops.h: Update documentation comments. Tested powerpc64le-linux. Committed to trunk. commit 5b965dc49a6a4293ce85bc3a24ca3f3855469e68 Author: Jonathan Wakely Date: Fri Jul 23 11:03:23 2021 libstdc++: Update documentation comments for namespace rel_ops The comments in describe problems that were solved years ago (for GCC 3.1). The comparison operators in are no longer ambiguous with the rel_ops ones, so the linked mailing list thread and FAQ entry aren't relevant now. The reference to std_utility.h is also outdated as it's just called utility now, both in the source tree and when installed. The use of rel_ops is still frowned upon though, so replace the discussion of ambiguities within libstdc++ headers with adminition about using rel_ops in user code. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/stl_relops.h: Update documentation comments. diff --git a/libstdc++-v3/include/bits/stl_relops.h b/libstdc++-v3/include/bits/stl_relops.h index 276894c435a..ef522031318 100644 --- a/libstdc++-v3/include/bits/stl_relops.h +++ b/libstdc++-v3/include/bits/stl_relops.h @@ -52,13 +52,8 @@ * This is an internal header file, included by other library headers. * Do not attempt to use it directly. @headername{utility} * - * Inclusion of this file has been removed from - * all of the other STL headers for safety reasons, except std_utility.h. - * For more information, see the thread of about twenty messages starting - * with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or - * http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads - * - * Short summary: the rel_ops operators should be avoided for the present. + * This file is only included by ``, which is required by the + * standard to define namespace `rel_ops` and its contents. */ #ifndef _STL_RELOPS_H @@ -72,6 +67,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { /** @namespace std::rel_ops * @brief The generated relational operators are sequestered here. + * + * Libstdc++ headers must not use the contents of `rel_ops`. + * User code should also avoid them, because unconstrained function + * templates are too greedy and can easily cause ambiguities. + * + * C++20 default comparisons are a better solution. */ /**