summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-18 13:57:35 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-18 13:57:35 +0000
commite24f096c9ca01e08460ebd1c3bbe1a565eb57a8a (patch)
treec7c4ac2c47c31bad7bac45dc8ac89ff36f5c1af2
parentba06212fdef3a57ef18da6d8210f7fdfb00c3cdd (diff)
downloadppe42-gcc-e24f096c9ca01e08460ebd1c3bbe1a565eb57a8a.tar.gz
ppe42-gcc-e24f096c9ca01e08460ebd1c3bbe1a565eb57a8a.zip
PR c++/5658
* search.c (setup_class_bindings): A class template qualifies as a type binding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52469 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/search.c6
-rw-r--r--gcc/testsuite/g++.dg/template/inherit2.C19
3 files changed, 28 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b7e31a4fdc5..c5c097d224e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2002-04-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/5658
+ * search.c (setup_class_bindings): A class template qualifies as a
+ type binding.
+
2002-04-17 Jakub Jelinek <jakub@redhat.com>
PR c++/6316
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 6e8ac11a038..779b37a6e33 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1839,7 +1839,7 @@ check_final_overrider (overrider, basefn)
return 0;
}
- /* Check throw specifier is subset. */
+ /* Check throw specifier is at least as strict. */
if (!comp_except_specs (base_throw, over_throw, 0))
{
cp_error_at ("looser throw specifier for `%#F'", overrider);
@@ -2390,14 +2390,14 @@ setup_class_bindings (name, type_binding_p)
if (type_binding_p
&& (TREE_CODE (value_binding) == TYPE_DECL
+ || DECL_CLASS_TEMPLATE_P (value_binding)
|| (TREE_CODE (value_binding) == TREE_LIST
&& TREE_TYPE (value_binding) == error_mark_node
&& (TREE_CODE (TREE_VALUE (value_binding))
== TYPE_DECL))))
/* We found a type-binding, even when looking for a non-type
binding. This means that we already processed this binding
- above. */
- my_friendly_assert (type_binding_p, 19990401);
+ above. */;
else if (value_binding)
{
if (TREE_CODE (value_binding) == TREE_LIST
diff --git a/gcc/testsuite/g++.dg/template/inherit2.C b/gcc/testsuite/g++.dg/template/inherit2.C
new file mode 100644
index 00000000000..0e2eba3239d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit2.C
@@ -0,0 +1,19 @@
+// PR c++/5658
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Theodore.Papadopoulo 11 Feb 2002 <Theodore.Papadopoulo@sophia.inria.fr>
+
+struct A {
+ typedef int iterator;
+};
+template <typename T>
+struct B: public A {
+ template <typename U>
+ struct iterator {
+ };
+ B() { }
+};
+int main()
+{
+ B<int> a;
+};
OpenPOWER on IntegriCloud