PR c++/35650
* parser.c (cp_parser_lookup_name): Look through single function
OVERLOAD.
* g++.dg/init/ref17.C: New test.
From-SVN: r134788
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.
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.
--- /dev/null
+// 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;
+}