From: Nathan Sidwell Date: Thu, 2 May 2019 12:42:32 +0000 (+0000) Subject: [C++ PATCH] remove unreachable code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2aa34b5a968a2d92b294a7216c8dac656d3d265;p=gcc.git [C++ PATCH] remove unreachable code https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00039.html * semantics.c (finish_id_expression_1): Remove unreachable code. From-SVN: r270792 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3213b4aa2df..129a00a5314 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2019-05-02 Nathan Sidwell + + * semantics.c (finish_id_expression_1): Remove unreachable code. + 2019-05-01 Nathan Sidwell * name-lookup.h (get_class_binding_direct): Change final arg to diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index c9193657333..93bd8fb8a17 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3740,17 +3740,13 @@ finish_id_expression_1 (tree id_expression, wrong, so just return the identifier. */ return id_expression; - if (TREE_CODE (decl) == NAMESPACE_DECL) - { - error ("use of namespace %qD as expression", decl); - return error_mark_node; - } - else if (DECL_CLASS_TEMPLATE_P (decl)) + if (DECL_CLASS_TEMPLATE_P (decl)) { error ("use of class template %qT as expression", decl); return error_mark_node; } - else if (TREE_CODE (decl) == TREE_LIST) + + if (TREE_CODE (decl) == TREE_LIST) { /* Ambiguous reference to base members. */ error ("request for member %qD is ambiguous in "