[PATCH] D24848: [clang-tidy] fix false-positive for cppcoreguidelines-pro-type-member-init with in-class initializers

Malcolm Parsons via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 27 12:32:08 PDT 2016


malcolm.parsons added a comment.

In https://reviews.llvm.org/D24848#554145, @mgehre wrote:

> Rename the struct that was introduced in the test. Note that I need to keep the function Bug30487,
>  because that is where the false-positive warning was emitted.


https://reviews.llvm.org/D24965 will allow you to write a positive test instead:

  struct PositivePartiallyInClassInitialized {
    // CHECK-MESSAGES: :[[@LINE-1]]:8: warning: constructor does not initialize these fields: G
    int F = 0;
    int G;
    // CHECK-FIXES: int G{};
  };


https://reviews.llvm.org/D24848





More information about the cfe-commits mailing list