aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/search.c2
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash46.C8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash47.C17
5 files changed, 31 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0e1012f..6e44c4f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
1999-08-18 Mark Mitchell <mark@codesourcery.com>
+ * search.c (setup_class_bindings): Robustify.
+ * typeck.c (common_type): Use same_type_p, not pointer equality,
+ to compare types.
+
* cp-tree.h (build_lang_field_decl): Remove.
* class.c (build_vtable): Replace calls to build_lang_field_decl
with build_lang_decl.
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 300d710..62fa402 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -2960,7 +2960,7 @@ setup_class_bindings (name, type_binding_p)
binding. This means that we already processed this binding
above. */
my_friendly_assert (type_binding_p, 19990401);
- else
+ else if (value_binding)
{
if (TREE_CODE (value_binding) == TREE_LIST
&& TREE_TYPE (value_binding) == error_mark_node)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 5d12bee..716fe19 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -698,7 +698,7 @@ common_type (t1, t2)
tt1 = TYPE_MAIN_VARIANT (tt1);
tt2 = TYPE_MAIN_VARIANT (tt2);
- if (tt1 == tt2)
+ if (same_type_p (tt1, tt2))
target = tt1;
else if (b1)
{
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash46.C b/gcc/testsuite/g++.old-deja/g++.pt/crash46.C
new file mode 100644
index 0000000..e226559
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash46.C
@@ -0,0 +1,8 @@
+// Build don't link:
+// Origin: Leon Bottou <leonb@research.att.com>
+
+class AA { protected:
+ template <class T> struct BB { T x; BB(const T &x) : x(x) { }; };
+ template <class T> struct CC : public BB<T> { CC(const T &x) : BB<T>(x) { };
+};
+};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash47.C b/gcc/testsuite/g++.old-deja/g++.pt/crash47.C
new file mode 100644
index 0000000..96a23fd
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash47.C
@@ -0,0 +1,17 @@
+// Build don't link:
+// Origin: Rick Campbell <rick.campbell@db.com>
+
+template <class Owner, typename Type>
+struct DataMember
+{
+ inline DataMember (Type Owner::* data_member);
+
+ Type Owner::* _data_member;
+};
+
+template <class Owner, typename Type>
+inline
+DataMember<Owner,Type>::DataMember (Type Owner::* data_member)
+ : _data_member (data_member)
+{
+}