This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH] Handle also switch for -Wdangling-else


On Wed, May 04, 2016 at 09:54:29PM +0200, Jakub Jelinek wrote:
> Hi!
> 
> This patch let us warn about danling else even if there is a switch
> without {}s around the body.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2016-05-04  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* c-parser.c (c_parser_switch_statement): Add IF_P argument,
> 	parse it through to c_parser_c99_block_statement.
> 	(c_parser_statement_after_labels): Adjust c_parser_switch_statement
> 	caller.
> 
> 	* parser.c (cp_parser_selection_statement): For RID_SWITCH,
> 	pass if_p instead of NULL to cp_parser_implicitly_scoped_statement.
> 
> 	* c-c++-common/Wdangling-else-4.c: New test.

Ok, thanks.

	Marek


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