forked from OSchip/llvm-project
[flang] Expunge bogus semantic check for ELEMENTAL without dummies
Semantics refuses valid ELEMENTAL subprograms without dummy arguments, but there's no such constraint in the standard; indeed, subclause 15.8.2 discusses the meaning of calls to ELEMENTAL functions with arguments. Remove the check and its test. Differential Revision: https://reviews.llvm.org/D111832
This commit is contained in:
parent
8e54f24f89
commit
1062f989af
|
@ -899,9 +899,6 @@ void CheckHelper::CheckSubprogram(
|
|||
// See comment on the similar check in CheckProcEntity()
|
||||
if (details.isDummy()) {
|
||||
messages_.Say("A dummy procedure may not be ELEMENTAL"_err_en_US);
|
||||
} else if (details.dummyArgs().empty()) {
|
||||
messages_.Say(
|
||||
"An ELEMENTAL subprogram must have at least one dummy argument"_err_en_US);
|
||||
} else {
|
||||
for (const Symbol *dummy : details.dummyArgs()) {
|
||||
if (!dummy) { // C15100
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
! RUN: %python %S/test_errors.py %s %flang_fc1
|
||||
! Tests ELEMENTAL subprogram constraints C15100-15102
|
||||
|
||||
!ERROR: An ELEMENTAL subprogram must have at least one dummy argument
|
||||
elemental integer function noargs
|
||||
noargs = 1
|
||||
end function
|
||||
|
||||
!ERROR: An ELEMENTAL subroutine may not have an alternate return dummy argument
|
||||
elemental subroutine altret(*)
|
||||
end subroutine
|
||||
|
|
Loading…
Reference in New Issue