[all-commits] [llvm/llvm-project] e9c0c6: [libc++] Add [[nodiscard]] to std::prev and std::n...

Marc Auberer via All-commits all-commits at lists.llvm.org
Sat Sep 28 13:56:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e9c0c6604e47a7cda323544217c056f7f5aec888
      https://github.com/llvm/llvm-project/commit/e9c0c6604e47a7cda323544217c056f7f5aec888
  Author: Marc Auberer <marc.auberer at chillibits.com>
  Date:   2024-09-28 (Sat, 28 Sep 2024)

  Changed paths:
    M libcxx/include/__iterator/next.h
    M libcxx/include/__iterator/prev.h
    M libcxx/test/libcxx/diagnostics/iterator.nodiscard.verify.cpp
    M libcxx/test/libcxx/iterators/assert.next.pass.cpp
    M libcxx/test/libcxx/iterators/assert.prev.pass.cpp

  Log Message:
  -----------
  [libc++] Add [[nodiscard]] to std::prev and std::next (#109550)

Add `[[nodiscard]]` attribute to `std::prev` and `std::next`. Those are
potential pitfalls for users who might think they mutate the iterator.

Fixes #109452



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