diff options
author | Jason Merrill <jason@redhat.com> | 2020-04-28 12:27:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-04-28 14:37:36 -0400 |
commit | bce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1 (patch) | |
tree | 6f38b1eb92da669605d2d65982ae70939c525b64 /gcc/cp/method.c | |
parent | 5eae0ac76dcb6aac1d1d6c4edd8852e0035792e4 (diff) | |
download | gcc-bce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1.zip gcc-bce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1.tar.gz gcc-bce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1.tar.bz2 |
c++: Redeclaration of implicit operator== [PR94583]
My last patch rejected a namespace-scope declaration of the
implicitly-declared friend operator== before the class, but redeclaring it
after the class should be OK.
gcc/cp/ChangeLog
2020-04-28 Jason Merrill <jason@redhat.com>
PR c++/94583
* decl.c (use_eh_spec_block): Check nothrow type after
DECL_DEFAULTED_FN.
* pt.c (maybe_instantiate_noexcept): Call synthesize_method for
DECL_MAYBE_DELETED fns here.
* decl2.c (mark_used): Not here.
* method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 2fb0de2..fb2dd47 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -2411,16 +2411,13 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, tree get_defaulted_eh_spec (tree decl, tsubst_flags_t complain) { + /* For DECL_MAYBE_DELETED this should already have been handled by + synthesize_method. */ + gcc_assert (!DECL_MAYBE_DELETED (decl)); + if (DECL_CLONED_FUNCTION_P (decl)) decl = DECL_CLONED_FUNCTION (decl); special_function_kind sfk = special_function_p (decl); - if (sfk == sfk_comparison) - { - /* We're in synthesize_method. Start with NULL_TREE, build_comparison_op - will adjust as needed. */ - gcc_assert (decl == current_function_decl); - return NULL_TREE; - } tree ctype = DECL_CONTEXT (decl); tree parms = FUNCTION_FIRST_USER_PARMTYPE (decl); tree parm_type = TREE_VALUE (parms); |