Commit 58627576 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/35650 (Can't bind ref-to-function through using-decl. in namespace)

	PR c++/35650
	* parser.c (cp_parser_lookup_name): Look through single function
	OVERLOAD.

	* g++.dg/init/ref17.C: New test.

From-SVN: r134788
parent f2be060f
2008-04-29 Jakub Jelinek <jakub@redhat.com>
PR c++/35650
* parser.c (cp_parser_lookup_name): Look through single function
OVERLOAD.
PR c++/35987
* typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
COMPOUND_EXPR if the second argument would be error_mark_node.
......
......@@ -16447,6 +16447,13 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
decl = lookup_qualified_name (parser->scope, name,
tag_type != none_type,
/*complain=*/true);
/* If we have a single function from a using decl, pull it out. */
if (decl
&& TREE_CODE (decl) == OVERLOAD
&& !really_overloaded_fn (decl))
decl = OVL_FUNCTION (decl);
if (pushed_scope)
pop_scope (pushed_scope);
}
......
2008-04-29 Jakub Jelinek <jakub@redhat.com>
PR c++/35650
* g++.dg/init/ref17.C: New test.
PR c++/35987
* g++.dg/other/error28.C: New test.
// PR c++/35650
// { dg-do compile }
void f1 ();
namespace N
{
using::f1;
void f2 ();
void f3 ();
}
using N::f3;
void
test ()
{
void (&a) () = f1;
void (&b) () = N::f1;
void (&c) () = N::f2;
void (&d) () = f3;
void (&e) () = ::f3;
}
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