[gcc r10-10467] Revert "c++: using overloaded with local decl [PR92918]"

Jason Merrill jason@gcc.gnu.org
Thu Feb 17 23:13:27 GMT 2022


https://gcc.gnu.org/g:b4e92ae2cacb0ef539326249fc59f790423a0766

commit r10-10467-gb4e92ae2cacb0ef539326249fc59f790423a0766
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Feb 17 18:11:23 2022 -0500

    Revert "c++: using overloaded with local decl [PR92918]"
    
           PR c++/104476
    
    This reverts commit decd38f99dd05eb54ddcaee7c52f21a56a844613.

Diff:
---
 gcc/cp/name-lookup.c                  |  2 +-
 gcc/testsuite/g++.dg/lookup/using66.C | 23 -----------------------
 2 files changed, 1 insertion(+), 24 deletions(-)

diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index f8caa16fc76..533d79542c9 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -4552,7 +4552,7 @@ push_class_level_binding_1 (tree name, tree x)
 	old_decl = bval;
       else if (TREE_CODE (bval) == USING_DECL
 	       && OVL_P (target_decl))
-	old_decl = bval;
+	return true;
       else if (OVL_P (target_decl)
 	       && OVL_P (target_bval))
 	old_decl = bval;
diff --git a/gcc/testsuite/g++.dg/lookup/using66.C b/gcc/testsuite/g++.dg/lookup/using66.C
deleted file mode 100644
index 02383bbea3e..00000000000
--- a/gcc/testsuite/g++.dg/lookup/using66.C
+++ /dev/null
@@ -1,23 +0,0 @@
-// PR c++/92918
-// { dg-do compile { target c++11 } }
-
-struct Base03
-{
-    static void impl();
-};
-
-struct Problem : Base03
-{
-    using Base03::impl;
-    static int impl(char const *);
-
-    template <typename T>
-    auto f(const T &t) const
-    -> decltype(impl(t))
-    {
-        return impl(t);
-    }
-};
-
-Problem t;
-int i = t.f("42");


More information about the Gcc-cvs mailing list