Skip to content

[flang] Silence spurious errors from benign USE errors #106097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ static bool IsBlockData(const Symbol &symbol) {
}

void CheckHelper::Check(const Symbol &symbol) {
if (symbol.has<UseErrorDetails>()) {
return;
}
if (symbol.name().size() > common::maxNameLen &&
&symbol == &symbol.GetUltimate()) {
if (context_.ShouldWarn(common::LanguageFeature::LongNames)) {
Expand Down
6 changes: 6 additions & 0 deletions flang/test/Semantics/resolve82.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end function procFunc
real y
common /blk/ y
protected y
logical,protected,external,pointer :: z

contains

Expand All @@ -60,3 +61,8 @@ subroutine testProcDecl(arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11)
end subroutine testProcDecl

end module m

subroutine subb()
!Ensure no spurious error from a benign UseError
use m, testProcDecl=>z
end
Loading