[all-commits] [llvm/llvm-project] 33af74: Fix "use after move" in iterator_range

Andy Kaylor via All-commits all-commits at lists.llvm.org
Mon Aug 14 11:04:41 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 33af74d6a02dc8d2980a2abb3ed94dafbeb46c30
  Author: Andy Kaylor <andrew.kaylor at intel.com>
  Date:   2023-08-14 (Mon, 14 Aug 2023)

  Changed paths:
    M llvm/include/llvm/ADT/iterator_range.h

  Log Message:
  Fix "use after move" in iterator_range

A static analysis tool reported a "use after move" error in a place where the
same object was being passed to two different calls using std::forward. While
this seems unlikely to present an actual problem, removing the std::forward
makes the code slightly more robust.

This relates to the comments here: https://reviews.llvm.org/D152891#inline-1522454

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

More information about the All-commits mailing list