Skip to content

Commit 1062f98

Browse files
committed
[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
1 parent 8e54f24 commit 1062f98

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

flang/lib/Semantics/check-declarations.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,9 +899,6 @@ void CheckHelper::CheckSubprogram(
899899
// See comment on the similar check in CheckProcEntity()
900900
if (details.isDummy()) {
901901
messages_.Say("A dummy procedure may not be ELEMENTAL"_err_en_US);
902-
} else if (details.dummyArgs().empty()) {
903-
messages_.Say(
904-
"An ELEMENTAL subprogram must have at least one dummy argument"_err_en_US);
905902
} else {
906903
for (const Symbol *dummy : details.dummyArgs()) {
907904
if (!dummy) { // C15100

flang/test/Semantics/elemental01.f90

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
! RUN: %python %S/test_errors.py %s %flang_fc1
22
! Tests ELEMENTAL subprogram constraints C15100-15102
33

4-
!ERROR: An ELEMENTAL subprogram must have at least one dummy argument
5-
elemental integer function noargs
6-
noargs = 1
7-
end function
8-
94
!ERROR: An ELEMENTAL subroutine may not have an alternate return dummy argument
105
elemental subroutine altret(*)
116
end subroutine

0 commit comments

Comments
 (0)