===================================================================
@@ -12205,6 +12205,7 @@ lookup_and_check_tag (enum tag_types tag_code, tre
/* First try ordinary name lookup, ignoring hidden class name
injected via friend declaration. */
decl = lookup_name_prefer_type (name, 2);
+ decl = strip_using_decl (decl);
/* If that fails, the name will be placed in the smallest
non-class, non-function-prototype scope according to 3.3.1/5.
We may already have a hidden name declared as friend in this
===================================================================
@@ -0,0 +1,16 @@
+// PR c++/60894
+
+struct B
+{
+ struct S {};
+};
+
+struct D : B
+{
+ using B::S;
+ void doIt(struct S&);
+};
+
+void D::doIt(struct S&)
+{
+}