This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Handle also switch for -Wdangling-else
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 5 May 2016 10:54:27 +0200
- Subject: Re: [PATCH] Handle also switch for -Wdangling-else
- Authentication-results: sourceware.org; auth=none
- References: <20160504195429 dot GU26501 at tucnak dot zalov dot cz>
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