summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-30 12:17:01 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-03-30 12:17:01 +0000
commitffe183cac0751b2101e38ea9baffd603ef0d822f (patch)
tree08ca0bc571598c2548204f0b3ea2452c06f8a88e /gcc
parent1486870d76c8ec5ab28664fa7dcadd8ccc5e9723 (diff)
downloadgcc-ffe183cac0751b2101e38ea9baffd603ef0d822f.tar.gz
* pt.c (fn_type_unification): Allow incomplete unification without
an immediate error message. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/unify2.C27
3 files changed, 37 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f7d586f8c99..7fdc60b264d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 30 12:15:00 1998 Mark Mitchell <mmitchell@usa.net>
+
+ * pt.c (fn_type_unification): Allow incomplete unification without
+ an immediate error message.
+
Mon Mar 30 08:55:42 1998 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (member_p): New fn.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4f87928cfc1..779d06c8aa4 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5325,12 +5325,16 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
fn_arg_types = scratch_tree_cons (NULL_TREE, extra_fn_arg,
fn_arg_types);
+ /* We allow incomplete unification without an error message here
+ because the standard doesn't seem to explicitly prohibit it. Our
+ callers must be ready to deal with unification failures in any
+ event. */
i = type_unification (DECL_INNERMOST_TEMPLATE_PARMS (fn),
targs,
fn_arg_types,
decl_arg_types,
explicit_targs,
- strict, 0);
+ strict, 1);
return i;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/unify2.C b/gcc/testsuite/g++.old-deja/g++.pt/unify2.C
new file mode 100644
index 00000000000..89b043d7901
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/unify2.C
@@ -0,0 +1,27 @@
+// Build don't link:
+
+template <class T>
+struct S
+{
+ typedef T S_Type;
+};
+
+
+template <class T>
+void foo(typename S<T>::S_Type)
+{
+}
+
+
+template <class T>
+void foo(T)
+{
+}
+
+
+struct S2 {};
+
+void bar()
+{
+ foo(S2()); // We can't unify with the first foo, so we get the second.
+}