[flang] Turn "error" cases into warning for "indistinguishable" specific procedures (#79621)
When a generic procedure interface, either declared or the result of merging two use-associated generics, has two specific procedures that are not distinguishable according to the rules in F'2023 subclause 15.4.3.4.5, emit a portability warning rather than a hard error message. The rules in that subclause are not adequate to detect pairs of specific procedures that admit an ambiguous reference, as demonstrated by a case that arose in pFUnit. Further, these distinguishability checks, even if sufficient to the task of detecting pairs of specifics capable of ambiguous references, should only apply to pairs where *every* reference would have to be ambiguous -- and this can and is validated at every reference anyway. Last, only XLF enforces these incomplete and needless distinguishability rules -- every other compiler seems to just check that each procedure reference resolves to exactly one specific procedure. If the standard were to complete lose subclause 15.4.3.4.5 and its related note (C.11.6) -- which admits that the rules are incomplete! -- and simply require that each generic procedure reference resolve unambiguously to exactly one specific, nobody would miss them. This patch changes this compiler to give them lip service when requested, but they are now otherwise ignored.
Loading
Please sign in to comment