This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/85312] New: trunk/gcc/cp/parser.c:12041: poor error checking ?
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Apr 2018 07:21:37 +0000
- Subject: [Bug c++/85312] New: trunk/gcc/cp/parser.c:12041: poor error checking ?
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85312
Bug ID: 85312
Summary: trunk/gcc/cp/parser.c:12041: poor error checking ?
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dcb314 at hotmail dot com
Target Milestone: ---
trunk/gcc/cp/parser.c:12041] -> [trunk/gcc/cp/parser.c:12044]: (warning)
Identical inner 'if' condition is always true.
Source code is
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));
}
I think the error messages can never be reached. This looks wrong to me.