[all-commits] [llvm/llvm-project] 1dd8da: [flang] Fix semantics check for RETURN statement

Emil Kieri via All-commits all-commits at lists.llvm.org
Mon May 2 13:06:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1dd8da2d7c75c2a34bf85a37a819755d60ddfb2b
      https://github.com/llvm/llvm-project/commit/1dd8da2d7c75c2a34bf85a37a819755d60ddfb2b
  Author: Emil Kieri <j.emil.kieri at gmail.com>
  Date:   2022-05-02 (Mon, 02 May 2022)

  Changed paths:
    M flang/lib/Semantics/check-return.cpp
    M flang/test/Semantics/altreturn02.f90
    A flang/test/Semantics/altreturn07.f90

  Log Message:
  -----------
  [flang] Fix semantics check for RETURN statement

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

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D124732




More information about the All-commits mailing list