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
This commit is contained in:
parent
f2be060fd3
commit
58627576a4
@ -1,5 +1,9 @@
|
||||
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);
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
23
gcc/testsuite/g++.dg/init/ref17.C
Normal file
23
gcc/testsuite/g++.dg/init/ref17.C
Normal file
@ -0,0 +1,23 @@
|
||||
// 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user