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
This commit is contained in:
parent
8a9b2875db
commit
e13d2b4e53
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2006-04-15 Kazu Hirata <kazu@codesourcery.com>
|
||||||
|
|
||||||
* Make-lang.in (cp/pt.o): Depend on vecprim.h.
|
* 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)
|
if (TREE_CODE (name) == SCOPE_REF)
|
||||||
{
|
{
|
||||||
/* A qualified name. The qualifying class or namespace `S' has
|
/* A qualified name. The qualifying class or namespace `S'
|
||||||
already been looked up; it is either a TYPE or a
|
has already been looked up; it is either a TYPE or a
|
||||||
NAMESPACE_DECL. The member name is either an IDENTIFIER_NODE
|
NAMESPACE_DECL. */
|
||||||
or a BIT_NOT_EXPR. */
|
|
||||||
scope = TREE_OPERAND (name, 0);
|
scope = TREE_OPERAND (name, 0);
|
||||||
name = TREE_OPERAND (name, 1);
|
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
|
/* If SCOPE is a namespace, then the qualified name does not
|
||||||
name a member of OBJECT_TYPE. */
|
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;
|
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. */
|
/* Find the base of OBJECT_TYPE corresponding to SCOPE. */
|
||||||
access_path = lookup_base (object_type, scope, ba_check, NULL);
|
access_path = lookup_base (object_type, scope, ba_check, NULL);
|
||||||
if (access_path == error_mark_node)
|
if (access_path == error_mark_node)
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2006-04-16 Paul Thomas <pault@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/26787
|
PR fortran/26787
|
||||||
|
13
gcc/testsuite/g++.dg/template/crash45.C
Normal file
13
gcc/testsuite/g++.dg/template/crash45.C
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// PR c++/26365
|
||||||
|
|
||||||
|
struct A {};
|
||||||
|
|
||||||
|
namespace N
|
||||||
|
{
|
||||||
|
template<int> void foo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void bar(A *p)
|
||||||
|
{
|
||||||
|
p->N::foo<0>; // { dg-error "not a member" }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user