This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch ping: Patch for PR c++/27495 regression bug
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 10 Jul 2006 14:24:40 -0700 (PDT)
- Subject: Patch ping: Patch for PR c++/27495 regression bug
- Reply-to: sje at cup dot hp dot com
This is a patch ping for my patch to PR c++/27495. I did not change the
patch but I have added a test case since the last submission.
OK to check in on mainline and 4.1 branch?
Tested on IA64 HP-UX and Linux.
Steve Ellcey
sje@cup.hp.com
2006-07-10 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
Testsuite ChangeLog and new test:
2006-07-10 Steve Ellcey <sje@cup.hp.com>
PR c++/27495
* g++.dg/other/pr27495.C: New.
Index: g++.dg/other/pr27495.C
===================================================================
--- g++.dg/other/pr27495.C (revision 0)
+++ g++.dg/other/pr27495.C (revision 0)
@@ -0,0 +1,8 @@
+
+// Test to make sure we do not ICE on this invalid program.
+
+struct A
+{
+ template<int> void foo();
+ void bar() { this.A::foo<0>(); } // { dg-error "" }
+};