From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E7F43846027; Thu, 3 Jun 2021 09:46:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E7F43846027 From: "tobi at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tobi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jun 2021 09:46:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100891 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.=