[all-commits] [llvm/llvm-project] a2e15f: [clang-tidy] Harden PreferMemberInitializerCheck

Nathan James via All-commits all-commits at lists.llvm.org
Mon Feb 22 11:41:34 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2e15fa532f36db7080347fbae31470c8ceaffc4
      https://github.com/llvm/llvm-project/commit/a2e15fa532f36db7080347fbae31470c8ceaffc4
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
    M clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-prefer-member-initializer.cpp

  Log Message:
  -----------
  [clang-tidy] Harden PreferMemberInitializerCheck

Prevent warning when the values are initialized using fields that will be initialized later or VarDecls defined in the constructors body.
Both of these cases can't be safely fixed.
Also improve logic of finding where to insert member initializers, previously it could be confused by in class member initializers.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list