You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang] Restore error status for many indistinguishable specifics (#79927)
A recent patch to allow pFUnit to compile softened the diagnostic about
indistinguishable specific procedures to a portability warning. It turns
out that this was overkill -- for specific procedures containing no
optional or unlimited polymorphic dummy data arguments, a diagnosis of
"indistinguishable" can still be a hard error.
So adjust the analysis to be tri-state: two procedures are either
definitely distinguishable, definitely indistinguishable without
optionals or unlimited polymorphics, or indeterminate. Emit errors as
before for the definitely indistinguishable cases; continue to emit
portability warnings for the indeterminate cases.
When this patch is merged, all but one of the dozen or so tests that I
disabled in llvm-test-suite can be re-enabled.
"Generic '%s' should not have specific procedures '%s' and '%s' as their interfaces are not distinguishable by the incomplete rules in the standard"_port_en_US,
3561
+
isError
3562
+
? "Generic '%s' may not have specific procedures '%s' and '%s' as their interfaces are not distinguishable"_err_en_US
3563
+
: "Generic '%s' should not have specific procedures '%s' and '%s' as their interfaces are not distinguishable by the rules in the standard"_port_en_US,
"USE-associated generic '%s' should not have specific procedures '%s' and '%s' as their interfaces are not distinguishable by the incomplete rules in the standard"_port_en_US,
3567
+
isError
3568
+
? "USE-associated generic '%s' may not have specific procedures '%s' and '%s' as their interfaces are not distinguishable"_err_en_US
3569
+
: "USE-associated generic '%s' should not have specific procedures '%s' and '%s' as their interfaces are not distinguishable by the incomplete rules in the standard"_port_en_US,
! Check for distinguishability of defined I/O procedures defined within
3
3
! and outside their types.
4
4
module m1
5
5
typet1
6
6
integer n
7
7
contains
8
8
procedure:: readt1a, readt1b
9
-
!PORTABILITY: Generic 'read(unformatted)' should not have specific procedures 'readt1a' and 'readt1b' as their interfaces are not distinguishable by the incomplete rules in the standard
9
+
!ERROR: Generic 'read(unformatted)' may not have specific procedures 'readt1a' and 'readt1b' as their interfaces are not distinguishable
10
10
generic ::read(unformatted) => readt1a, readt1b
11
11
endtype
12
12
typet2
@@ -15,7 +15,7 @@ module m1
15
15
typet3
16
16
integer n
17
17
endtype
18
-
!PORTABILITY: Generic 'read(unformatted)' should not have specific procedures 'readt2a' and 'readt2b' as their interfaces are not distinguishable by the incomplete rules in the standard
18
+
!ERROR: Generic 'read(unformatted)' may not have specific procedures 'readt2a' and 'readt2b' as their interfaces are not distinguishable
!PORTABILITY: Generic 'indistinguishable' should not have specific procedures 's2b' and 's2a' as their interfaces are not distinguishable by the incomplete rules in the standard
77
+
!ERROR: Generic 'indistinguishable' may not have specific procedures 's2b' and 's2a' as their interfaces are not distinguishable
Copy file name to clipboardExpand all lines: flang/test/Semantics/resolve17.f90
+3-3
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ subroutine sb(y)
96
96
end
97
97
end
98
98
subroutines6
99
-
!ERROR: Generic 'g' should not have specific procedures 'sa' and 'sb' as their interfaces are not distinguishable by the incomplete rules in the standard
99
+
!ERROR: Generic 'g' may not have specific procedures 'sa' and 'sb' as their interfaces are not distinguishable
100
100
use m6a, g => gg
101
101
use m6b, g => gg
102
102
end
@@ -180,7 +180,7 @@ subroutine g()
180
180
end
181
181
end module
182
182
subroutines9
183
-
!PORTABILITY: USE-associated generic 'g' should not have specific procedures 'g' and 'g' as their interfaces are not distinguishable by the incomplete rules in the standard
183
+
!ERROR: USE-associated generic 'g' may not have specific procedures 'g' and 'g' as their interfaces are not distinguishable
184
184
use m9a
185
185
use m9b
186
186
end
@@ -197,7 +197,7 @@ subroutine s(x)
197
197
end
198
198
module m10b
199
199
use m10a
200
-
!PORTABILITY: Generic 'g' should not have specific procedures 's' and 's' as their interfaces are not distinguishable by the incomplete rules in the standard
200
+
!ERROR: Generic 'g' may not have specific procedures 's' and 's' as their interfaces are not distinguishable
0 commit comments