-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Disallow intrinsics and statement functions from generics
Generic interfaces are not permitted to have intrinsic procedures or statement functions as specific procedures. Differential Revision: https://reviews.llvm.org/D145103
- Loading branch information
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
! RUN: %python %S/test_errors.py %s %flang_fc1 | ||
module m | ||
!ERROR: Specific procedure 'sin' of generic interface 'yintercept' may not be INTRINSIC | ||
intrinsic sin | ||
interface yIntercept | ||
procedure sin | ||
end interface | ||
!ERROR: Specific procedure 'cos' of generic interface 'xintercept' may not be INTRINSIC | ||
intrinsic cos | ||
generic :: xIntercept => cos | ||
end module | ||
|
||
subroutine foo | ||
interface slope | ||
procedure tan | ||
end interface | ||
!ERROR: Specific procedure 'tan' of generic interface 'slope' may not be a statement function | ||
tan(x) = sin(x) / cos(x) | ||
end subroutine | ||
|