PR c++/38030
* semantics.c (finish_call_expr): Remember the result of
non-dependent overload resolution.
From-SVN: r141866
2008-11-14 Jason Merrill <jason@redhat.com>
+ PR c++/38030
+ * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
+ for a non-dependent call.
+
PR c++/37740
* call.c (build_aggr_conv): Increment i.
if (processing_template_decl)
{
result = build_call_list (TREE_TYPE (result), orig_fn, orig_args);
- KOENIG_LOOKUP_P (result) = koenig_p;
+ /* Don't repeat arg-dependent lookup at instantiation time if this call
+ is not type-dependent. */
+ KOENIG_LOOKUP_P (result) = 0;
}
return result;
}
2008-11-14 Jason Merrill <jason@redhat.com>
+ PR c++/38030
+ * g++.dg/template/lookup8.C: New test.
+
PR c++/37740
* g++.dg/cpp0x/initlist8.C: New test.
--- /dev/null
+// PR c++/38030
+// The call to f should be resolved at template definition time.
+// { dg-do link }
+
+struct B { };
+struct D : public B { };
+D d;
+void f (B &) { }
+template < class T >
+void g ()
+{
+ return f (d);
+}
+void f (D &);
+int main ()
+{
+ g<int> ();
+ return 0;
+}