public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100891] New: #pragma GCC diagnostic ignored
@ 2021-06-03  9:46 tobi at gcc dot gnu.org
  2021-06-03 12:04 ` [Bug c++/100891] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: tobi at gcc dot gnu.org @ 2021-06-03  9:46 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/100891] #pragma GCC diagnostic ignored
  2021-06-03  9:46 [Bug c++/100891] New: #pragma GCC diagnostic ignored tobi at gcc dot gnu.org
@ 2021-06-03 12:04 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-03 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this is another dup of PR 53431

*** This bug has been marked as a duplicate of bug 53431 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-03 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03  9:46 [Bug c++/100891] New: #pragma GCC diagnostic ignored tobi at gcc dot gnu.org
2021-06-03 12:04 ` [Bug c++/100891] " redi at gcc dot gnu.org

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).