Commit 1ffe6573 by Mark Mitchell Committed by Mark Mitchell

re PR c++/12397 (two-stage name lookup argument shadowed by global type)

	PR c++/12397
	* typeck.c (finish_class_member_access_expr): Don't tree
	IDENTIFIER_NODEs as non-dependent expressions.

	PR c++/12397
	* g++.dg/template/lookup3.C: New test.

From-SVN: r74949
parent a6444561
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12397
* typeck.c (finish_class_member_access_expr): Don't tree
IDENTIFIER_NODEs as non-dependent expressions.
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/5050
......
......@@ -1809,6 +1809,9 @@ finish_class_member_access_expr (tree object, tree name)
{
if (/* If OBJECT_TYPE is dependent, so is OBJECT.NAME. */
dependent_type_p (object_type)
/* If NAME is just an IDENTIFIER_NODE, then the expression
is dependent. */
|| TREE_CODE (object) == IDENTIFIER_NODE
/* If NAME is "f<args>", where either 'f' or 'args' is
dependent, then the expression is dependent. */
|| (TREE_CODE (name) == TEMPLATE_ID_EXPR
......
2003-12-22 Mark Mitchell <mark@codesourcery.com>
PR c++/12397
* g++.dg/template/lookup3.C: New test.
2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
* g++.dg/template/recurse1.C: New test
......
// PR c++/12397
struct foo { };
template <typename T> struct bar
{
bar(){}
int i;
bar (const bar<T>& foo) : i (foo.i) {}
};
int main()
{
bar<int> b1;
bar<int> b2(b1);
}
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