+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.
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.
--- /dev/null
+// { 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;