mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 19:06:44 +00:00
[flang] Silence spurious error (#106086)
Don't attempt to give an object a default binding label when it shows up in a declaration after it has already been given an explicit binding label in an earlier declaration. Fixes https://github.com/llvm/llvm-project/issues/106019.
This commit is contained in:
parent
c4b7c47fa5
commit
961a138237
@ -1797,6 +1797,9 @@ void AttrsVisitor::SetBindNameOn(Symbol &symbol) {
|
||||
}
|
||||
auto last{label->find_last_not_of(" ")};
|
||||
label = label->substr(first, last - first + 1);
|
||||
} else if (symbol.GetIsExplicitBindName()) {
|
||||
// don't try to override explicit binding name with default
|
||||
return;
|
||||
} else if (ClassifyProcedure(symbol) == ProcedureDefinitionClass::Internal) {
|
||||
// BIND(C) does not give an implicit binding label to internal procedures.
|
||||
return;
|
||||
|
@ -50,6 +50,9 @@ module m
|
||||
!ERROR: BIND_C attribute was already specified on 's5'
|
||||
integer, bind(c, name="ss2") :: s5
|
||||
|
||||
integer, bind(c, name="s6explicit") :: s6
|
||||
dimension s6(10) ! caused spurious error
|
||||
|
||||
end
|
||||
|
||||
subroutine common1()
|
||||
|
Loading…
x
Reference in New Issue
Block a user