This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] PR c++/90590 Suppress warning for enumeration value not handled in switch warning

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

Ah, without TYPE_MAIN_VARIANT there's this ICEs:

/opt/notnfs/polacek/gcc/libstdc++-v3/src/c++11/ In function ‘void {anonymous}::print_field({anonymous}::PrintContext&, const _Parameter&, const char*)’:
/opt/notnfs/polacek/gcc/libstdc++-v3/src/c++11/ internal compiler error: Segmentation fault
  791 |     }
      |     ^
0xf31def crash_signal
0xaaa579 contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*)
0xaaa579 c_do_switch_warnings(splay_tree_s*, unsigned int, tree_node*, tree_node*, bool)
0x8ab61f pop_switch()
0x9e0af4 finish_switch_stmt(tree_node*)
0x95764d cp_parser_selection_statement
0x95764d cp_parser_statement
0x958770 cp_parser_statement_seq_opt
0x958847 cp_parser_compound_statement
0x971990 cp_parser_function_body
0x971990 cp_parser_ctor_initializer_opt_and_function_body
0x972216 cp_parser_function_definition_after_declarator
0x972fae cp_parser_function_definition_from_specifiers_and_declarator
0x972fae cp_parser_init_declarator
0x954ecf cp_parser_simple_declaration
0x9798a2 cp_parser_declaration
0x97a46c cp_parser_declaration_seq_opt
0x97a46c cp_parser_namespace_body
0x97a46c cp_parser_namespace_definition
0x9799b3 cp_parser_declaration
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]