[all-commits] [llvm/llvm-project] 1f2d40: [clang-tidy] fix duplicate '{}' in cppcoreguidelin...

Liu Ke via All-commits all-commits at lists.llvm.org
Fri Aug 13 21:13:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f2d40c47f5f8fd01d91d73a1f52044fe1c83225
      https://github.com/llvm/llvm-project/commit/1f2d40c47f5f8fd01d91d73a1f52044fe1c83225
  Author: liuke <liuke.gehry at bytedance.com>
  Date:   2021-08-14 (Sat, 14 Aug 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
    M clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h
    M clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp

  Log Message:
  -----------
  [clang-tidy] fix duplicate '{}' in cppcoreguidelines-pro-type-member-init

The overload of the constructor will repeatedly fix the member variables that need to be initialized.
Removed the duplicate '{}'.

```
struct A {
  A() {}
  A(int) {}
  int _var;  // int _var{}{};  <--  wrong fix
};
```

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list