public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tobi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/100891] New: #pragma GCC diagnostic ignored
Date: Thu, 03 Jun 2021 09:46:30 +0000	[thread overview]
Message-ID: <bug-100891-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100891

            Bug ID: 100891
           Summary: #pragma GCC diagnostic ignored
           Product: gcc
           Version: 10.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tobi at gcc dot gnu.org
  Target Milestone: ---

$ cat t.cpp
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmultichar"

// Check that I'm disabling warnings correctly: the following warnings
disappear correctly:
#pragma GCC diagnostic ignored "-Wnarrowing"
#pragma GCC diagnostic ignored "-Woverflow"
#endif
            constexpr int native{ 'ABCD' };
            constexpr short i{123456}; // crosscheck
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
$ g++ -Wall -c t.cpp
t.cpp:8:35: warning: multi-character character constant [-Wmultichar]
             constexpr int native{ 'ABCD' };
                                   ^~~~~~
$

Compiler explorer link here: https://godbolt.org/z/P5cjqKs4a

Verified with all versions on the compiler explorer back to 6.2.

             reply	other threads:[~2021-06-03  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  9:46 tobi at gcc dot gnu.org [this message]
2021-06-03 12:04 ` [Bug c++/100891] " redi at gcc dot gnu.org

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=bug-100891-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).