From patchwork Mon Jul 22 15:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1963299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GUJHw6l3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WSPRj5q9Jz1yZ7 for ; Tue, 23 Jul 2024 01:32:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C286B385E44D for ; Mon, 22 Jul 2024 15:32:47 +0000 (GMT) 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.129.124]) by sourceware.org (Postfix) with ESMTP id 666CE385DDEE for ; Mon, 22 Jul 2024 15:32:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 666CE385DDEE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 666CE385DDEE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721662347; cv=none; b=qEJVpkKZbPJuYXCEbIrdEY3kRVpnOprudB88Tmjo1fn0lHQnbbhOcrIXTbFFwhbR6s14AecJIAZ9DpFKRubBxn2Zsu7D21uk3v1rF6+C5vQDaTahW/bVMjyMriVYW8oHfCcQHm6ssO3walnWrjjY5w1l4HtFI55m6027HQjDDgI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721662347; c=relaxed/simple; bh=x6jSWo1gQ7QX2c95nM7QO+sU8Zc9dBdunQwkd1/ck34=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=YGWNu362rBAunhx4uddDoZMeAYFzOFrFqGD/Wixf81WXVTHXb7RK27G9z/tc0a5yPZgkh46YWz+9sEgEAPwrsm38M2iflsM5in2FKp6hkJ8/yhEKMn4O9TokJNfz1vmEkUafp5qQOjCkxkD9eahcEs+jsyJTKFh/STzoPsHZBks= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721662345; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=I/Gt9KR/RTFnktfaJnWePYpO+xA+6QLnQXIKlgINAxY=; b=GUJHw6l3vCmIIqrmFmR+V7iHcQD7YZE/nd5VNQtejkczvnPsmUj7OnUoL4g1lcCnAfbKkS cr73+s8HEJUlvOi2biiWilf6CNfKRbJBp4BguPA11e4w4BYyK/lXqlugR0tznTYRrYCJ/a J6nkGNPy0m6E7etI7Pxs1M9jC4jsJXU= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-671-efcAgoasOYukzszTHY8LRQ-1; Mon, 22 Jul 2024 11:32:23 -0400 X-MC-Unique: efcAgoasOYukzszTHY8LRQ-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 289A31955BF6 for ; Mon, 22 Jul 2024 15:32:22 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.25]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0C408195605A; Mon, 22 Jul 2024 15:32:20 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 46MFWIOh1565895 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 22 Jul 2024 17:32:18 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 46MFWHVf1565894; Mon, 22 Jul 2024 17:32:17 +0200 Date: Mon, 22 Jul 2024 17:32:17 +0200 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] c++: Some cp-tree.def comment fixes Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! While reading the fold expression and concept tree comments, I found various spots referring to non-existent macros etc. The following patch attempts to sync that with what is actually implemented. Ok for trunk? 2024-07-22 Jakub Jelinek * cp-tree.def (UNARY_LEFT_FOLD_EXPR): Use FOLD_EXPR_MODIFY_P instead of FOLD_EXPR_MOD_P or FOLDEXPR_MOD_P in the comment. Comment formatting fixes. (ATOMIC_CONSTEXPR): Use CONSTR_INFO instead of ATOMIC_CONSTR_INFO and ATOMIC_CONSTR_MAP instead of ATOMIC_CONSTR_PARMS in the comment. Comment formatting fixes. (CONJ_CONSTR): Remove comment about third operand. Use CONSTR_INFO instead of CONJ_CONSTR_INFO and DISJ_CONSTR_INFO. (CHECK_CONSTR): Use CHECK_CONSTR_ARGS instead of CHECK_CONSTR_ARGUMENTS. Jakub --- gcc/cp/cp-tree.def.jj 2024-04-09 09:29:04.709521893 +0200 +++ gcc/cp/cp-tree.def 2024-07-22 17:26:32.053101302 +0200 @@ -412,17 +412,17 @@ DEFTREECODE (ARGUMENT_PACK_SELECT, "argu /* Fold expressions allow the expansion of a template argument pack over a binary operator. - FOLD_EXPR_MOD_P is true when the fold operation is a compound assignment + FOLD_EXPR_MODIFY_P is true when the fold operation is a compound assignment operator. FOLD_EXPR_OP is an INTEGER_CST storing the tree code for the folded - expression. Note that when FOLDEXPR_MOD_P is true, the operator is + expression. Note that when FOLD_EXPR_MODIFY_P is true, the operator is a compound assignment operator for that kind of expression. FOLD_EXPR_PACK is an expression containing an unexpanded parameter pack; when expanded, each term becomes an argument of the folded expression. - In a BINARY_FOLD_EXPRESSION, FOLD_EXPR_INIT is the non-pack argument. */ + In a BINARY_FOLD_EXPRESSION, FOLD_EXPR_INIT is the non-pack argument. */ DEFTREECODE (UNARY_LEFT_FOLD_EXPR, "unary_left_fold_expr", tcc_expression, 2) DEFTREECODE (UNARY_RIGHT_FOLD_EXPR, "unary_right_fold_expr", tcc_expression, 2) DEFTREECODE (BINARY_LEFT_FOLD_EXPR, "binary_left_fold_expr", tcc_expression, 3) @@ -518,24 +518,23 @@ DEFTREECODE (NESTED_REQ, "nested_req", t /* Constraints are modeled as kinds of expressions. The operands of a constraint can be either types or expressions. - Unlike expressions, constraints do not have a type. */ + Unlike expressions, constraints do not have a type. */ /* An atomic constraint evaluates an expression E. The operand of the - constraint is its parameter mapping. The actual expression is stored + constraint is its parameter mapping. The actual expression is stored in the context. - ATOMIC_CONSTR_INFO provides source info to support diagnostics. + CONSTR_INFO provides source info to support diagnostics. ATOMIC_CONSTR_EXPR has the expression to be evaluated. - ATOMIC_CONSTR_PARMS is the parameter mapping for the atomic constraint + ATOMIC_CONSTR_MAP is the parameter mapping for the atomic constraint and is stored in the type field. */ DEFTREECODE (ATOMIC_CONSTR, "atomic_constr", tcc_expression, 1) /* The conjunction and disjunction of two constraints, respectively. - Operands are accessed using TREE_OPERAND. The third operand provides - source info for diagnostics. + Operands are accessed using TREE_OPERAND. - CONJ_CONSTR_INFO and DISJ_CONSTR_INFO provide access to the source - information of constraints, which is stored in the TREE_TYPE. */ + CONSTR_INFO provides access to the source information of constraints, + which is stored in the TREE_TYPE. */ DEFTREECODE (CONJ_CONSTR, "conj_constr", tcc_expression, 2) DEFTREECODE (DISJ_CONSTR, "disj_constr", tcc_expression, 2) @@ -544,7 +543,7 @@ DEFTREECODE (DISJ_CONSTR, "disj_constr", and a sequence of template arguments. CHECK_CONSTR_CONCEPT has the concept definition - CHECK_CONSTR_ARGUMENTS are the template arguments */ + CHECK_CONSTR_ARGS are the template arguments. */ DEFTREECODE (CHECK_CONSTR, "check_constr", tcc_expression, 2) /* The co_await expression is used to support coroutines.