[all-commits] [llvm/llvm-project] 051847: Improve the 'modernize-use-default-member-init'

rb-integration via All-commits all-commits at lists.llvm.org
Tue Jan 4 04:28:02 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 051847cfecaea3f55fc4f822facfbf5d21bde8dd
      https://github.com/llvm/llvm-project/commit/051847cfecaea3f55fc4f822facfbf5d21bde8dd
  Author: Oleg Smolsky <oleg.smolsky at gmail.com>
  Date:   2022-01-04 (Tue, 04 Jan 2022)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst
    M clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init.cpp

  Log Message:
  -----------
  Improve the 'modernize-use-default-member-init'

We want to deal with non-default constructors that just happen to
contain constant initializers. There was already a negative test case,
it is now a positive one. We find and refactor this case:

struct PositiveNotDefaultInt {
  PositiveNotDefaultInt(int) : i(7) {}
  int i;
};




More information about the All-commits mailing list