This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: PR c++/27495 - avoid ICE on invalid code.
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Jun 2006 07:50:55 -0700 (PDT)
- Subject: Patch: PR c++/27495 - avoid ICE on invalid code.
- Reply-to: sje at cup dot hp dot com
This patch stops the parser from calling
adjust_result_of_qualified_name_lookup with a non-class type. This
avoids the assert in adjust_result_of_qualified_name_lookup that happens
with non-class types. A proper error is then given by
finish_class_member_access_expr.
Tested with no regressions on IA64 HP-UX.
OK for checkin? Should I backport it to the 4.0 and 4.1 branches too?
Steve Ellcey
sje@cup.hp.com
2006-06-22 Steve Ellcey <sje@cup.hp.com>
PR c++/27495
* cp/parser.c (cp_parser_postfix_dot_deref_expression): Do not
call adjust_result_of_qualified_name_lookup with non-class type.
Index: cp/parser.c
===================================================================
--- cp/parser.c (revision 114878)
+++ cp/parser.c (working copy)
@@ -4535,7 +4535,7 @@ cp_parser_postfix_dot_deref_expression (
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
}
- if (scope && name && BASELINK_P (name))
+ if (scope && CLASS_TYPE_P (scope) && name && BASELINK_P (name))
adjust_result_of_qualified_name_lookup
(name, BINFO_TYPE (BASELINK_BINFO (name)), scope);
postfix_expression