public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH to abate shift warnings (PR c++/68979)
Date: Tue, 12 Jan 2016 14:09:00 -0000	[thread overview]
Message-ID: <56950922.1020607@redhat.com> (raw)
In-Reply-To: <20160112140552.GG25528@redhat.com>

On 01/12/2016 09:05 AM, Marek Polacek wrote:
> On Tue, Jan 12, 2016 at 08:27:47AM -0500, Jason Merrill wrote:
>> Changing the diagnostic is OK, but cxx_eval_check_shift_p should return true
>> regardless of flag_permissive, so that SFINAE results follow the standard.
>
> There's a complication, because if I keep returning true, we'll give a
> compile-time error like this:
>
> permissive-1.C:5:18: warning: left operand of shift expression ‘(-1 << 4)’ is
> negative [-fpermissive]
>   enum A { AA = -1 << 4 }; // { dg-warning "operand of shift expression" "" {
> target c++11 } }
>
> permissive-1.C:5:21: error: enumerator value for ‘AA’ is not an integer
> constant
>   enum A { AA = -1 << 4 }; // { dg-warning "operand of shift expression" "" {
> target c++11 } }
>
> So I suppose that wouldn't really help.  :(

In that case, we need to return (!flag_permissive || ctx->quiet).

Jason

  reply	other threads:[~2016-01-12 14:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 12:52 Marek Polacek
2016-01-12 13:02 ` Jakub Jelinek
2016-01-12 13:12   ` Marek Polacek
2016-01-12 13:27 ` Jason Merrill
2016-01-12 14:05   ` Marek Polacek
2016-01-12 14:09     ` Jason Merrill [this message]
2016-01-12 14:16       ` Marek Polacek
2016-01-12 16:38         ` 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=56950922.1020607@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@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).