[all-commits] [llvm/llvm-project] c8f81e: [clang-tidy] bugprone-use-after-move: Ctor argumen...

martinboehme via All-commits all-commits at lists.llvm.org
Thu May 4 05:05:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8f81ee1da325760a4bbd83c8c54ecc9645f8e20
      https://github.com/llvm/llvm-project/commit/c8f81ee1da325760a4bbd83c8c54ecc9645f8e20
  Author: Martin Braenne <mboehme at google.com>
  Date:   2023-05-04 (Thu, 04 May 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/utils/ExprSequence.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp

  Log Message:
  -----------
  [clang-tidy] bugprone-use-after-move: Ctor arguments should be sequenced if ctor call is written as list-initialization.

See

https://timsong-cpp.github.io/cppwp/n4868/dcl.init#list-4

This eliminates a false positive in bugprone-use-after-move; this newly added
test used to be falsely classified as a use-after-move:

```
    A a;
    S3 s3{a.getInt(), std::move(a)};
```

Reviewed By: PiotrZSL

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




More information about the All-commits mailing list