[all-commits] [llvm/llvm-project] 973ca4: [flang] Call finalization on empty type (#66010)

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Mon Sep 11 14:34:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 973ca4e4a2d11763fa6f8016d7f14ddd20006b7b
      https://github.com/llvm/llvm-project/commit/973ca4e4a2d11763fa6f8016d7f14ddd20006b7b
  Author: Valentin Clement (バレンタイン クレメン) <clementval at gmail.com>
  Date:   2023-09-11 (Mon, 11 Sep 2023)

  Changed paths:
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/test/Lower/derived-type-finalization.f90

  Log Message:
  -----------
  [flang] Call finalization on empty type (#66010)

According to 7.5.6.3 point 3, finalization occurs when

> A nonpointer, nonallocatable object that is not a dummy argument or
function result is finalized immediately before it would become
undefined due to execution of a RETURN or END statement (19.6.6, item
(3)).

We were not calling the finalization on empty derived-type. There is no
such restriction so this patch updates the code so the finalization is
called for empty type as well.




More information about the All-commits mailing list