This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: PR c++/27495 - avoid ICE on invalid code.

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

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

2006-06-22  Steve Ellcey  <>

	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))
 	      (name, BINFO_TYPE (BASELINK_BINFO (name)), scope);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]