public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Gcc Patch List <gcc-patches@gcc.gnu.org>,
	Jason Merrill <jason@redhat.com>
Subject: [PATCH] document cp_operator_id and cp_assignment_operator_id
Date: Thu, 15 Jun 2017 16:57:00 -0000	[thread overview]
Message-ID: <620e2b9e-a77e-167d-52e3-0b34efa688a5@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Attached is a documentation-only change to add comments explaining
the C++ cp_operator_id and cp_assignment_operator_id macros.

Martin

[-- Attachment #2: gcc-cp_operator_id-doc.diff --]
[-- Type: text/x-patch, Size: 1045 bytes --]

gcc/cp/ChangeLog:

	* cp-tree.h (cp_operator_id, cp_assignment_operator_id): Document.

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index da45d95..234441b 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1731,9 +1731,16 @@ struct GTY(()) language_function {
    || (NAME) == cp_operator_id (DELETE_EXPR)	\
    || (NAME) == cp_operator_id (VEC_DELETE_EXPR))
 
+/* Evaluates to an id matching operator CODE.  Used to obtain the set
+   of operator overloads for the specified CODE.  */
 #define cp_operator_id(CODE) \
   (operator_name_info[(int) (CODE)].identifier)
-#define cp_assignment_operator_id(CODE) \
+
+/* An id matching a member assignment operator CODE, both simple (with
+   CODE == NOP_EXPR) and compound (e.g., with CODE == PLUS_EXPR for +=).
+   Includes copy assignment.  Use copy_fn_p() to test specifically for
+   copy assignment.  */
+#define cp_assignment_operator_id(CODE)				\
   (assignment_operator_name_info[(int) (CODE)].identifier)
 /* In parser.c.  */
 extern tree cp_literal_operator_id (const char *);

             reply	other threads:[~2017-06-15 16:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 16:57 Martin Sebor [this message]
2017-06-15 21:25 ` Jason Merrill
2017-06-15 22:57   ` Martin Sebor
2017-07-01 21:42     ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=620e2b9e-a77e-167d-52e3-0b34efa688a5@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).