Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,14 @@ void CheckHelper::CheckSubprogram(
messages_.Say(details.result().name(),
"A function interface may not declare an assumed-length CHARACTER(*) result"_err_en_US);
}
if (symbol.attrs().test(Attr::ABSTRACT) &&
(symbol.name() == "integer" || symbol.name() == "unsigned" ||
symbol.name() == "real" || symbol.name() == "complex" ||
symbol.name() == "character" ||
symbol.name() == "logical")) { // F'2023 C1503
messages_.Say(
"An ABSTRACT interface may not have the same name as an intrinsic type"_err_en_US);
}
}
CheckExternal(symbol);
CheckModuleProcedureDef(symbol);
Expand Down
6 changes: 6 additions & 0 deletions flang/test/Semantics/abstract02.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ program test
abstract interface
subroutine abstract
end subroutine
!ERROR: An ABSTRACT interface may not have the same name as an intrinsic type
function integer()
end
!ERROR: An ABSTRACT interface may not have the same name as an intrinsic type
subroutine logical
end
end interface
procedure(abstract), pointer :: p
!ERROR: Abstract procedure interface 'abstract' may not be referenced
Expand Down