aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-05-05 15:26:59 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-05-05 15:26:59 +0200
commit351f85c5be3287b3ab495195ff15c5fedf09303f (patch)
treeb1c40179c0f161d00823019b5aa3295ab05f47ee /gcc/c/c-parser.c
parentf5c40ce2cf8812d28e4738143a491bd77c0a0ce0 (diff)
downloadgcc-351f85c5be3287b3ab495195ff15c5fedf09303f.zip
gcc-351f85c5be3287b3ab495195ff15c5fedf09303f.tar.gz
gcc-351f85c5be3287b3ab495195ff15c5fedf09303f.tar.bz2
c-parser.c (c_parser_switch_statement): Add IF_P argument, parse it through to c_parser_c99_block_statement.
* 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. From-SVN: r235920
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index d275f8e..6523c08 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1305,7 +1305,7 @@ static void c_parser_statement (c_parser *, bool *);
static void c_parser_statement_after_labels (c_parser *, bool *,
vec<tree> * = NULL);
static void c_parser_if_statement (c_parser *, bool *, vec<tree> *);
-static void c_parser_switch_statement (c_parser *);
+static void c_parser_switch_statement (c_parser *, bool *);
static void c_parser_while_statement (c_parser *, bool, bool *);
static void c_parser_do_statement (c_parser *, bool);
static void c_parser_for_statement (c_parser *, bool, bool *);
@@ -5138,7 +5138,7 @@ c_parser_statement_after_labels (c_parser *parser, bool *if_p,
c_parser_if_statement (parser, if_p, chain);
break;
case RID_SWITCH:
- c_parser_switch_statement (parser);
+ c_parser_switch_statement (parser, if_p);
break;
case RID_WHILE:
c_parser_while_statement (parser, false, if_p);
@@ -5570,7 +5570,7 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain)
*/
static void
-c_parser_switch_statement (c_parser *parser)
+c_parser_switch_statement (c_parser *parser, bool *if_p)
{
struct c_expr ce;
tree block, expr, body, save_break;
@@ -5605,7 +5605,7 @@ c_parser_switch_statement (c_parser *parser)
c_start_case (switch_loc, switch_cond_loc, expr, explicit_cast_p);
save_break = c_break_label;
c_break_label = NULL_TREE;
- body = c_parser_c99_block_statement (parser, NULL/*if??*/);
+ body = c_parser_c99_block_statement (parser, if_p);
c_finish_case (body, ce.original_type);
if (c_break_label)
{