Commit 9aaceb4b by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/72 (aggressive type analysis in template-class's template-member-function)

cp:
	PR g++/72
	* decl.c (add_binding): Don't reject duplicate typedefs involving
	template parameters.
testsuite:
	* g++.dg/template/typedef1.C: New test.

From-SVN: r47854
parent fe7f5677
2001-12-10 Nathan Sidwell <nathan@codesourcery.com>
PR g++/72
* decl.c (add_binding): Don't reject duplicate typedefs involving
template parameters.
2001-12-10 Neil Booth <neil@daikokuya.demon.co.uk>
* parse.y, semantics.c: Similarly.
2001-12-04 Nathan Sidwell <nathan@codesourcery.com>
2001-12-09 Nathan Sidwell <nathan@codesourcery.com>
PR g++/87
* cp-tree.h (DECL_COPY_CONSTRUCTOR_P): Use copy_fn_p.
......
......@@ -981,8 +981,12 @@ add_binding (id, decl)
else if (TREE_CODE (BINDING_VALUE (binding)) == TYPE_DECL
&& TREE_CODE (decl) == TYPE_DECL
&& DECL_NAME (decl) == DECL_NAME (BINDING_VALUE (binding))
&& same_type_p (TREE_TYPE (decl),
TREE_TYPE (BINDING_VALUE (binding))))
&& (same_type_p (TREE_TYPE (decl),
TREE_TYPE (BINDING_VALUE (binding)))
/* If either type involves template parameters, we must
wait until instantiation. */
|| uses_template_parms (TREE_TYPE (decl))
|| uses_template_parms (TREE_TYPE (BINDING_VALUE (binding)))))
/* We have two typedef-names, both naming the same type to have
the same name. This is OK because of:
......
2001-12-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/template/typedef1.C: New test.
2001-12-09 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/other/copy1.C: New test.
......
// { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Dec 2001 <nathan@nathan@codesourcery.com>
// PR 72
template <typename T> struct A
{
typedef T type;
};
template <typename T> struct B
{
typedef int xxx;
typedef T xxx;
typedef typename A<T>::type xxx;
typedef A<int>::type xxx;
};
B<int> good;
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