From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7489 invoked by alias); 12 Jul 2019 22:49:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7476 invoked by uid 89); 12 Jul 2019 22:49:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=28016 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jul 2019 22:49:34 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B5475946B for ; Fri, 12 Jul 2019 22:49:33 +0000 (UTC) Received: from redhat.com (ovpn-120-231.rdu2.redhat.com [10.10.120.231]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EF335C205; Fri, 12 Jul 2019 22:49:32 +0000 (UTC) Date: Fri, 12 Jul 2019 23:00:00 -0000 From: Marek Polacek To: Matthew Beliveau Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning Message-ID: <20190712224930.GT5989@redhat.com> References: <20190712183859.GQ5989@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190712183859.GQ5989@redhat.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-SW-Source: 2019-07/txt/msg01005.txt.bz2 On Fri, Jul 12, 2019 at 02:38:59PM -0400, Marek Polacek wrote: > On Fri, Jul 12, 2019 at 02:34:37PM -0400, Matthew Beliveau wrote: > > @@ -1628,6 +1629,16 @@ c_do_switch_warnings (splay_tree cases, location_t switch_location, > > if (cond && tree_int_cst_compare (cond, value)) > > continue; > > > > + /* If the enumerator is defined in a system header and uses a reserved > > + name, then we continue to avoid throwing a warning. */ > > + location_t loc = DECL_SOURCE_LOCATION > > + (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (type))); > > As I mentioned before, I wonder if we can get away without the > TYPE_MAIN_VARIANT here. Ah, without TYPE_MAIN_VARIANT there's this ICEs: /opt/notnfs/polacek/gcc/libstdc++-v3/src/c++11/debug.cc: In function ‘void {anonymous}::print_field({anonymous}::PrintContext&, const _Parameter&, const char*)’: /opt/notnfs/polacek/gcc/libstdc++-v3/src/c++11/debug.cc:791:5: internal compiler error: Segmentation fault 791 | } | ^ 0xf31def crash_signal /opt/notnfs/polacek/gcc/gcc/toplev.c:326 0xaaa579 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) /opt/notnfs/polacek/gcc/gcc/tree.h:3330 0xaaa579 c_do_switch_warnings(splay_tree_s*, unsigned int, tree_node*, tree_node*, bool) /opt/notnfs/polacek/gcc/gcc/c-family/c-warn.c:1634 0x8ab61f pop_switch() /opt/notnfs/polacek/gcc/gcc/cp/decl.c:3567 0x9e0af4 finish_switch_stmt(tree_node*) /opt/notnfs/polacek/gcc/gcc/cp/semantics.c:1229 0x95764d cp_parser_selection_statement /opt/notnfs/polacek/gcc/gcc/cp/parser.c:11964 0x95764d cp_parser_statement /opt/notnfs/polacek/gcc/gcc/cp/parser.c:11186 0x958770 cp_parser_statement_seq_opt /opt/notnfs/polacek/gcc/gcc/cp/parser.c:11667 0x958847 cp_parser_compound_statement /opt/notnfs/polacek/gcc/gcc/cp/parser.c:11621 0x971990 cp_parser_function_body /opt/notnfs/polacek/gcc/gcc/cp/parser.c:22651 0x971990 cp_parser_ctor_initializer_opt_and_function_body /opt/notnfs/polacek/gcc/gcc/cp/parser.c:22702 0x972216 cp_parser_function_definition_after_declarator /opt/notnfs/polacek/gcc/gcc/cp/parser.c:28016 0x972fae cp_parser_function_definition_from_specifiers_and_declarator /opt/notnfs/polacek/gcc/gcc/cp/parser.c:27932 0x972fae cp_parser_init_declarator /opt/notnfs/polacek/gcc/gcc/cp/parser.c:20288 0x954ecf cp_parser_simple_declaration /opt/notnfs/polacek/gcc/gcc/cp/parser.c:13546 0x9798a2 cp_parser_declaration /opt/notnfs/polacek/gcc/gcc/cp/parser.c:13243 0x97a46c cp_parser_declaration_seq_opt /opt/notnfs/polacek/gcc/gcc/cp/parser.c:13119 0x97a46c cp_parser_namespace_body /opt/notnfs/polacek/gcc/gcc/cp/parser.c:19335 0x97a46c cp_parser_namespace_definition /opt/notnfs/polacek/gcc/gcc/cp/parser.c:19313 0x9799b3 cp_parser_declaration /opt/notnfs/polacek/gcc/gcc/cp/parser.c:13223 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. So seems like we need it after all. Sorry about that. Marek