Page MenuHomePhabricator

[flang] Fix semantics check for RETURN statement
ClosedPublic

Authored by ekieri on May 1 2022, 12:16 AM.

Details

Summary

The RETURN statement is allowed in functions and subroutines, but not
in main programs. It is however a common extension, which we also
implement, to allow RETURN from main programs -- we only issue a
portability warning when -pedantic or -std=f2018 are set.

This patch fixes false positives for this portability warning, where it
was triggered also when RETURN was present in functions or subroutines.

Fixexs #55080

Diff Detail

Event Timeline

ekieri created this revision.May 1 2022, 12:16 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
ekieri requested review of this revision.May 1 2022, 12:16 AM
PeteSteinfeld accepted this revision.May 2 2022, 8:52 AM

All builds and tests without error and looks good.

Thanks for fixing this!

This revision is now accepted and ready to land.May 2 2022, 8:52 AM
This revision was automatically updated to reflect the committed changes.