aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/pt.c15
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/local5.C12
4 files changed, 29 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index af04741..3f795aa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-17 Geoffrey Keating <geoffk@apple.com>
+
+ PR c++/17413
+ * pt.c (type_unification_real): Apply template type deduction even
+ to procedure parameters that are not dependent on a template
+ parameter.
+
2005-06-16 Nathan Sidwell <nathan@codesourcery.com>
* rtti.c (get_tinfo_decl): Avoid caching tinfo_descs when it might
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f130859..e811201 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -9366,17 +9366,12 @@ type_unification_real (tree tparms,
else
type = arg;
- if (strict == DEDUCE_EXACT)
- {
- if (same_type_p (parm, type))
- continue;
- }
- else
- /* It might work; we shouldn't check now, because we might
- get into infinite recursion. Overload resolution will
- handle it. */
+ if (same_type_p (parm, type))
continue;
-
+ if (strict != DEDUCE_EXACT
+ && can_convert_arg (parm, type, TYPE_P (arg) ? NULL_TREE : arg))
+ continue;
+
return 1;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 68b98ff..321c87a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-17 Geoffrey Keating <geoffk@apple.com>
+
+ PR c++/17413
+ * g++.dg/template/local5.C: New.
+
2005-06-17 Richard Henderson <rth@redhat.com>
* gcc.dg/sync-2.c (do_qi): Cast negative results to char.
diff --git a/gcc/testsuite/g++.dg/template/local5.C b/gcc/testsuite/g++.dg/template/local5.C
new file mode 100644
index 0000000..705dca3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/local5.C
@@ -0,0 +1,12 @@
+struct Attribute { };
+
+template <class T> bool operator == (const Attribute &attr, const T &value);
+
+enum {
+ anon = 123
+};
+
+void test(int foo)
+{
+ if (foo == anon) ; /* { dg-bogus "anonymous type" } */
+}