diff options
author | Marek Polacek <polacek@redhat.com> | 2014-09-24 17:23:56 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-09-24 17:23:56 +0000 |
commit | 083e891e69429f93b958f6c18e2d52f515bae572 (patch) | |
tree | 5828257c837204733ae0f5091cb5468196499f9b /gcc/cp/semantics.c | |
parent | dc9c1b91e6be77b710751e935d6c1e09d1f289a1 (diff) | |
download | gcc-083e891e69429f93b958f6c18e2d52f515bae572.zip gcc-083e891e69429f93b958f6c18e2d52f515bae572.tar.gz gcc-083e891e69429f93b958f6c18e2d52f515bae572.tar.bz2 |
re PR c/61405 (Not emitting "enumeration value not handled in switch" warning for bit-field enums)
PR c/61405
PR c/53874
gcc/
* asan.c (maybe_instrument_call): Add default case.
* ipa-pure-const.c (special_builtin_state): Likewise.
* predict.c (expr_expected_value_1): Likewise.
* lto-streamer-out.c (write_symbol): Initialize variable.
gcc/c-family/
* c-common.h (struct c_common_resword): Don't define CPP_KEYWORD.
gcc/c/
* c-parser.c: Don't define CPP_KEYWORD.
(c_parser_switch_statement): Pass original type to c_finish_case.
* c-tree.h (c_finish_case): Update declaration.
* c-typeck.c (c_finish_case): Add TYPE parameter. Pass it
conditionally to c_do_switch_warnings.
gcc/cp/
* semantics.c (finish_switch_cond): Call unlowered_expr_type.
* tree.c (bot_manip): Add default case.
* parser.c (cp_parser_primary_expression): Cast the controlling
expression of a switch to an int.
(cp_parser_unqualified_id): Likewise.
gcc/testsuite/
* c-c++-common/pr53874.c: New test.
* c-c++-common/pr61405.c: New test.
libcpp/
* include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.
From-SVN: r215559
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 6e04e5e..2728f58 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1127,7 +1127,8 @@ finish_switch_cond (tree cond, tree switch_stmt) error ("switch quantity not an integer"); cond = error_mark_node; } - orig_type = TREE_TYPE (cond); + /* We want unlowered type here to handle enum bit-fields. */ + orig_type = unlowered_expr_type (cond); if (cond != error_mark_node) { /* Warn if the condition has boolean value. */ |