mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 19:06:44 +00:00
[flang] Silence spurious errors from benign USE errors (#106097)
When USE association encounters a conflict that can't be resolved, it produces a "UseError" symbol that will trigger an error message if that symbol is ever actually used. UseError symbols that aren't used are benign. Ensure that UseError symbols don't run the gamut of declaration checking. They were getting through, and could lead to spurious error messages. Fixes https://github.com/llvm/llvm-project/issues/106020.
This commit is contained in:
parent
961a138237
commit
7cc789bcfb
@ -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)) {
|
||||
|
@ -34,6 +34,7 @@ module m
|
||||
real y
|
||||
common /blk/ y
|
||||
protected y
|
||||
logical,protected,external,pointer :: z
|
||||
|
||||
contains
|
||||
|
||||
@ -60,3 +61,8 @@ contains
|
||||
end subroutine testProcDecl
|
||||
|
||||
end module m
|
||||
|
||||
subroutine subb()
|
||||
!Ensure no spurious error from a benign UseError
|
||||
use m, testProcDecl=>z
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user