Commit e13d2b4e by Mark Mitchell Committed by Mark Mitchell

re PR c++/26365 (ICE in finish_class_member_access_expr, at cp/typeck.c)

	PR c++/26365
	* typeck.c (finish_class_member_access_expr): Robustify
	PR c++/26365
	* g++.dg/template/crash45.C: New test.

From-SVN: r112986
parent 8a9b2875
2006-04-16 Mark Mitchell <mark@codesourcery.com>
PR c++/26365
* typeck.c (finish_class_member_access_expr): Robustify
2006-04-15 Kazu Hirata <kazu@codesourcery.com>
* Make-lang.in (cp/pt.o): Depend on vecprim.h.
......
......@@ -2046,16 +2046,11 @@ finish_class_member_access_expr (tree object, tree name, bool template_p)
if (TREE_CODE (name) == SCOPE_REF)
{
/* A qualified name. The qualifying class or namespace `S' has
already been looked up; it is either a TYPE or a
NAMESPACE_DECL. The member name is either an IDENTIFIER_NODE
or a BIT_NOT_EXPR. */
/* A qualified name. The qualifying class or namespace `S'
has already been looked up; it is either a TYPE or a
NAMESPACE_DECL. */
scope = TREE_OPERAND (name, 0);
name = TREE_OPERAND (name, 1);
gcc_assert (CLASS_TYPE_P (scope)
|| TREE_CODE (scope) == NAMESPACE_DECL);
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE
|| TREE_CODE (name) == BIT_NOT_EXPR);
/* If SCOPE is a namespace, then the qualified name does not
name a member of OBJECT_TYPE. */
......@@ -2066,6 +2061,10 @@ finish_class_member_access_expr (tree object, tree name, bool template_p)
return error_mark_node;
}
gcc_assert (CLASS_TYPE_P (scope));
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE
|| TREE_CODE (name) == BIT_NOT_EXPR);
/* Find the base of OBJECT_TYPE corresponding to SCOPE. */
access_path = lookup_base (object_type, scope, ba_check, NULL);
if (access_path == error_mark_node)
......
2006-04-16 Mark Mitchell <mark@codesourcery.com>
PR c++/26365
* g++.dg/template/crash45.C: New test.
2006-04-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26787
// PR c++/26365
struct A {};
namespace N
{
template<int> void foo();
}
void bar(A *p)
{
p->N::foo<0>; // { dg-error "not a member" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment