diff options
author | Nathan Sidwell <nathan@acm.org> | 2017-11-01 18:30:42 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2017-11-01 18:30:42 +0000 |
commit | 183e687af1dd8ca311712b5061c205a43ce1252c (patch) | |
tree | 202d41fd95c66b89850315710714b16e7eae2f18 /gcc/cp/decl.c | |
parent | d4b51b8ba058a79d9ef64cd03a3bc88d2c7fc6c6 (diff) | |
download | gcc-183e687af1dd8ca311712b5061c205a43ce1252c.zip gcc-183e687af1dd8ca311712b5061c205a43ce1252c.tar.gz gcc-183e687af1dd8ca311712b5061c205a43ce1252c.tar.bz2 |
[C++ PATCH] overloaded operator fns [8/N]
https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00031.html
* cp-tree.h (enum cp_identifier_kind): Delete cik_newdel_op.
Renumber and reserve udlit value.
(IDENTIFIER_NEWDEL_OP): Delete.
(IDENTIFIER_OVL_OP): New.
(IDENTIFIER_ASSIGN_OP): Adjust.
(IDENTIFIER_CONV_OP): Adjust.
(IDENTIFIER_OVL_OP_INFO): Adjust.
(IDENTIFIER_OVL_OP_FLAGS): New.
* decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
* lex.c (get_identifier_kind_name): Adjust.
(init_operators): Don't special case new/delete ops.
* mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP.
* pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
* typeck.c (check_return_expr): Likewise.
From-SVN: r254322
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d544d06..d88c78f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11744,7 +11744,8 @@ grokdeclarator (const cp_declarator *declarator, if (ctype && TREE_CODE (type) == FUNCTION_TYPE && staticp < 2 && !(identifier_p (unqualified_id) - && IDENTIFIER_NEWDEL_OP_P (unqualified_id))) + && IDENTIFIER_OVL_OP_P (unqualified_id) + && (IDENTIFIER_OVL_OP_FLAGS (unqualified_id) & OVL_OP_FLAG_ALLOC))) { cp_cv_quals real_quals = memfn_quals; if (cxx_dialect < cxx14 && constexpr_p @@ -11857,7 +11858,9 @@ grokdeclarator (const cp_declarator *declarator, if (virtualp && identifier_p (unqualified_id) - && IDENTIFIER_NEWDEL_OP_P (unqualified_id)) + && IDENTIFIER_OVL_OP_P (unqualified_id) + && (IDENTIFIER_OVL_OP_FLAGS (unqualified_id) + & OVL_OP_FLAG_ALLOC)) { error ("%qD cannot be declared %<virtual%>, since it " "is always static", unqualified_id); |