Commit d1ff0e2d authored by nathan's avatar nathan
Browse files

cp:

	PR c++/11704
	* pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with
	unknown type.
testsuite:
	PR c++/11704
	* g++.dg/template/dependent-expr2.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70119 138bc75d-0d04-0410-961f-82ee72b054a4
parent c8af9608
2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11704
* pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with
unknown type.
PR c++/11766
* typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to
member functions.
2003-08-02 Nathan Sidwell <nathan@codesourcery.com>
 
PR c++/9447
......
......@@ -11625,6 +11625,15 @@ type_dependent_expression_p (tree expression)
{
if (TREE_CODE (expression) == ADDR_EXPR)
return type_dependent_expression_p (TREE_OPERAND (expression, 0));
if (TREE_CODE (expression) == COMPONENT_REF)
{
if (type_dependent_expression_p (TREE_OPERAND (expression, 0)))
return true;
expression = TREE_OPERAND (expression, 1);
if (TREE_CODE (expression) == IDENTIFIER_NODE)
return false;
}
if (TREE_CODE (expression) == BASELINK)
expression = BASELINK_FUNCTIONS (expression);
if (TREE_CODE (expression) == TEMPLATE_ID_EXPR)
......
2003-08-03 Nathan Sidwell <nathan@codesourcery.com>
 
PR c++/11704
* g++.dg/template/dependent-expr2.C: New test.
PR c++/11766
* g++.dg/expr/ptrmem1.C: New test.
 
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 2 Aug 2003 <nathan@codesourcery.com>
// PR 11704. ICE
struct A
{
int foo()
{
return 5;
}
};
template <class T> // If B is not template it works
struct B
{
bool bar(A& a)
{
return a.foo == 0; // { dg-error "insufficient context" "" }
}
};
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