aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-parser.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2020-01-30 14:09:41 -0700
committerJeff Law <law@redhat.com>2020-01-30 14:09:41 -0700
commitf9eb0973edb2b4eed4cdbba7105b8af7afe5b547 (patch)
tree3f1610ca774902de4f92cdb9152a8f1ea944fb04 /gcc/c/c-parser.c
parent5fb07870fa4c86f529930bae76689ed5bdfcb192 (diff)
downloadgcc-f9eb0973edb2b4eed4cdbba7105b8af7afe5b547.zip
gcc-f9eb0973edb2b4eed4cdbba7105b8af7afe5b547.tar.gz
gcc-f9eb0973edb2b4eed4cdbba7105b8af7afe5b547.tar.bz2
Mark switch expression as used to avoid bogus warning
PR c/88660 * c-parser.c (c_parser_switch_statement): Make sure to request marking the switch expr as used. PR c/88660 * gcc.dg/pr88660.c: New test.
Diffstat (limited to 'gcc/c/c-parser.c')
-rw-r--r--gcc/c/c-parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 6164017..1e8f2f7 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -6607,7 +6607,7 @@ c_parser_switch_statement (c_parser *parser, bool *if_p)
&& c_token_starts_typename (c_parser_peek_2nd_token (parser)))
explicit_cast_p = true;
ce = c_parser_expression (parser);
- ce = convert_lvalue_to_rvalue (switch_cond_loc, ce, true, false);
+ ce = convert_lvalue_to_rvalue (switch_cond_loc, ce, true, true);
expr = ce.value;
/* ??? expr has no valid location? */
parens.skip_until_found_close (parser);