PR c++/85312 - P0962 cleanup
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Apr 2018 14:28:54 +0000 (16:28 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Apr 2018 14:28:54 +0000 (16:28 +0200)
PR c++/85312 - P0962 cleanup
* parser.c (cp_parser_perform_range_for_lookup): Remove unreachable
diagnostics.

From-SVN: r259279

gcc/cp/ChangeLog
gcc/cp/parser.c

index 42c3771b98da03080cf3d61ea37c13cb3ff88613..eeb1b2a9a212fd41607036568aa2168e12675df4 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/85312 - P0962 cleanup
+       * parser.c (cp_parser_perform_range_for_lookup): Remove unreachable
+       diagnostics.
+
 2018-04-10  Jason Merrill  <jason@redhat.com>
 
        PR debug/65821 - wrong location for main().
index 849a75a1a514791c43e14fcfdff8b60c697ab3cb..8b1b271b53d17205e547299bdc4074fb590354ef 100644 (file)
@@ -12041,17 +12041,8 @@ cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
       if (member_begin != NULL_TREE && member_end != NULL_TREE)
        {
          /* Use the member functions.  */
-         if (member_begin != NULL_TREE)
-           *begin = cp_parser_range_for_member_function (range, id_begin);
-         else
-           error ("range-based %<for%> expression of type %qT has an "
-                  "%<end%> member but not a %<begin%>", TREE_TYPE (range));
-
-         if (member_end != NULL_TREE)
-           *end = cp_parser_range_for_member_function (range, id_end);
-         else
-           error ("range-based %<for%> expression of type %qT has a "
-                  "%<begin%> member but not an %<end%>", TREE_TYPE (range));
+         *begin = cp_parser_range_for_member_function (range, id_begin);
+         *end = cp_parser_range_for_member_function (range, id_end);
        }
       else
        {