Index: flang/lib/Semantics/expression.cpp =================================================================== --- flang/lib/Semantics/expression.cpp +++ flang/lib/Semantics/expression.cpp @@ -2210,6 +2210,7 @@ // Create a renaming USE of the specific procedure. auto rename{context_.SaveTempName( used->symbol().owner().GetName().value().ToString() + "$" + + specific.owner().GetName().value().ToString() + "$" + specific.name().ToString())}; return *const_cast(scope) .try_emplace(rename, specific.attrs(), Index: flang/test/Semantics/modfile39.f90 =================================================================== --- flang/test/Semantics/modfile39.f90 +++ flang/test/Semantics/modfile39.f90 @@ -36,11 +36,11 @@ !Expect: m2.mod !module m2 !use m1,only:gen -!use m1,only:m1$priv=>priv -!private::m1$priv +!use m1,only:m1$m1$priv=>priv +!private::m1$m1$priv !contains !subroutine s(a) -!real(4)::a(1_8:int(m1$priv(1_4),kind=8)) +!real(4)::a(1_8:int(m1$m1$priv(1_4),kind=8)) !end !end