https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66712 Bug ID: 66712 Summary: [concepts] variadic concepts cause havoc Product: gcc Version: c++-concepts Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com Target Milestone: --- template concept bool _Constructible_ = requires (Args&&...args) { T{ ((Args&&)(args))... }; }; template constexpr bool _constructible_() { return false; } _Constructible_{T, ...Args...} constexpr bool _constructible_() { return true; } struct S { S(int, char const *); }; int main() { static_assert(_constructible_(), ""); } Result: temp.cpp: In function ‘int main()’: temp.cpp:22:55: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_base, at cp/search.c:224 static_assert(_constructible_(), ""); ^ temp.cpp:22:55: internal compiler error: Aborted g++: internal compiler error: Aborted (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See for instructions. The trouble with variadic concepts is a blocker for STL2. >From gcc-bugs-return-491082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 30 18:55:24 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 115684 invoked by alias); 30 Jun 2015 18:55:24 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 110129 invoked by uid 48); 30 Jun 2015 18:55:21 -0000 From: "steffen.muething at iwr dot uni-heidelberg.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66711] New: GCC does not correctly restore diagnostic state after pragma GCC diagnostic pop with -Werror Date: Tue, 30 Jun 2015 18:55:00 -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: 5.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: steffen.muething at iwr dot uni-heidelberg.de 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-06/txt/msg03414.txt.bz2 Content-length: 2456 https://gcc.gnu.org/bugzilla/show_bug.cgi?idf711 Bug ID: 66711 Summary: GCC does not correctly restore diagnostic state after pragma GCC diagnostic pop with -Werror Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: steffen.muething at iwr dot uni-heidelberg.de Target Milestone: --- Created attachment 35880 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5880&actioníit MWE, compile with "gcc -Wextra -Werror wrong-diagnostic-pop.c" GCC 5.1.0 fails to correctly restore the diagnostics state after a "#pragma GCC diagnostic pop" if the program was compiled with -Werror: Instead of emitting an error, the compiler insteads issues a warning after the pragma. I've attached a simple example file. When compiled with "-Wextra -Werror", I'd expect the output: """ error.cc: In function 'int main()': error.cc:9:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] x += x < y ? 1 : 0; ^ error.cc:18:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] x += x < y ? 1 : 0; ^ cc1plus: all warnings being treated as errors """ But I get the following: """ error.cc: In function 'int main()': error.cc:9:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] x += x < y ? 1 : 0; ^ error.cc:18:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] x += x < y ? 1 : 0; ^ cc1plus: all warnings being treated as errors """ The second diagnostic was turned into a warning. All older versions of GCC that I have available and that support diagnostic push/pop (4.6.4, 4.7.4, 4.8.4, 4.9.2) handle this correctly and issue an error in both cases. Example output from GCC 4.9.2: """ wrong-diagnostic-pop.c: In function 'main': wrong-diagnostic-pop.c:9:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] x += x < y ? 1 : 0; ^ wrong-diagnostic-pop.c:18:10: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] x += x < y ? 1 : 0; ^ cc1: all warnings being treated as errors """ The problem is also present in the C++ frontend.