Commit 8cc99a4d by Jason Merrill Committed by Jason Merrill

re PR c++/38030 (name-lookup for non-dependent name in template function is wrong)

        PR c++/38030
        * semantics.c (finish_call_expr): Remember the result of
        non-dependent overload resolution.

From-SVN: r141866
parent 2d2c68a3
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.
......
......@@ -1976,7 +1976,9 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p,
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.
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment