[all-commits] [llvm/llvm-project] 100582: Pass std::initializer_list by value to ArrayRef co...

Haojian Wu via All-commits all-commits at lists.llvm.org
Thu Oct 24 10:27:59 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 100582ed4f5189c661c365e1ba8b07eb3af0f844
      https://github.com/llvm/llvm-project/commit/100582ed4f5189c661c365e1ba8b07eb3af0f844
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2024-10-24 (Thu, 24 Oct 2024)

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

  Log Message:
  -----------
  Pass std::initializer_list by value to ArrayRef constructor. (#113590)

The std::initializer_list is a lightweight object, it is passed by value
in general.

This would also avoid a false positive when adding the lifetimebound
annotation (#113547)

```
ArrayRef<int> foo(std::initializer_list<int> list) {
  return ArrayRef<int>(list);
}
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list