public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <patrick@parcs.ath.cx>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix PR c++/21802 (two-stage name lookup fails for operators)
Date: Fri, 11 Dec 2015 20:40:00 -0000	[thread overview]
Message-ID: <566B34A6.3040707@redhat.com> (raw)
In-Reply-To: <1449863000-12193-1-git-send-email-patrick@parcs.ath.cx>

On 12/11/2015 02:43 PM, Patrick Palka wrote:
> +	  if (processing_template_decl
> +	      && result != NULL_TREE
> +	      && result != error_mark_node
> +	      && DECL_HIDDEN_FRIEND_P (cand->fn))
> +	    {
> +	      tree call = result;
> +	      if (REFERENCE_REF_P (call))
> +		call = TREE_OPERAND (call, 0);
> +	      KOENIG_LOOKUP_P (call) = 1;
> +	    }

This should have a comment explaining that this prevents 
build_new_function_call from discarding the function.

> +  if (op == PREINCREMENT_EXPR
> +      || op == PREDECREMENT_EXPR)
> +    gcc_assert (nargs == 1);
> +  else if (op == MODOP_EXPR)
> +    gcc_assert (nargs == 2);
> +  else
> +    gcc_assert (nargs == TREE_CODE_LENGTH (op));

This should use cp_tree_operand_length.

Jason

  reply	other threads:[~2015-12-11 20:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 21:43 Patrick Palka
2015-12-11 15:19 ` Patrick Palka
2015-12-11 19:43   ` Patrick Palka
2015-12-11 20:40     ` Jason Merrill [this message]
2015-12-12 23:32       ` Patrick Palka
2015-12-14 20:42         ` Jason Merrill
2015-12-15  0:14           ` Patrick Palka
2015-12-15  0:34             ` Jason Merrill
2015-12-16 21:46               ` Markus Trippelsdorf
2016-01-15  0:40                 ` Ryan Burn
2016-01-15  4:10                   ` [PATCH] Fix PR c++/21802 (two-stage name lookup fails for operators Patrick Palka
2016-04-09  8:11                     ` David Abdurachmanov
2015-12-16 19:25             ` [PATCH] Fix PR c++/21802 (two-stage name lookup fails for operators) Michael Matz
2015-12-16 21:31               ` Patrick Palka
2015-12-16 21:33                 ` 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=566B34A6.3040707@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patrick@parcs.ath.cx \
    /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).