public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Nathan Sidwell <nathan@acm.org>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] Fix 66243, silent cast of scoped enum
Date: Tue, 26 May 2015 07:49:00 -0000	[thread overview]
Message-ID: <5563C7FF.6030204@redhat.com> (raw)
In-Reply-To: <5563828D.4090403@acm.org>

On 05/25/2015 04:14 PM, Nathan Sidwell wrote:
> On 05/25/15 15:43, Jason Merrill wrote:
>> On 05/24/2015 07:20 PM, Nathan Sidwell wrote:
>>> -      else if (! INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value)))
>>> +      else if (! INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P
>>> +           (TREE_TYPE (value)))
>>>          value = perform_implicit_conversion_flags
>>>            (ENUM_UNDERLYING_TYPE (enumtype), value, tf_warning_or_error,
>>>             LOOKUP_IMPLICIT | LOOKUP_NO_NARROWING);
>>
>> The change is fine, but I wonder why perform_implicit_conversion_flags
>> was
>> succeeding?  I would think it should fail.
>
> It wasn't being executed.  The if condition is if *NOT*
> integral-or-enum.   The patch changes the check such that p_i_c_f is now
> executed for scoped enums  -- and emits an appropriate error.

Ah, of course, thanks.

Jason


      reply	other threads:[~2015-05-26  1:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25  1:26 Nathan Sidwell
2015-05-25 19:52 ` Jason Merrill
2015-05-25 20:29   ` Nathan Sidwell
2015-05-26  7:49     ` Jason Merrill [this message]

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=5563C7FF.6030204@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@acm.org \
    /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).