aaron.ballman added inline comments.

> ProTypeMemberInitCheck.cpp:307
> +                 Result.Nodes.getNodeAs<CXXRecordDecl>("record")) {
> +    assert(Record->hasDefaultConstructor());
> +    checkMissingMemberInitializer(*Result.Context, Record, nullptr);

Please add an explanatory string literal to the assert (that way, if it 
triggers, some more information is immediately available).

> ProTypeMemberInitCheck.cpp:372
>    // Do not propose fixes in macros since we cannot place them correctly.
> -  if (Ctor->getLocStart().isMacroID())
> +  if (Ctor && Ctor->getLocStart().isMacroID())
>      return;

Should also update the comment.

> cppcoreguidelines-pro-type-member-init.cpp:401
> +  // CHECK-FIXES: int F{};
> +};

Can you also add a test like:

  template <typename T>
  struct S {
    T Val;
    virtual ~S() = default;
  };
  
  template struct S<int>;

https://reviews.llvm.org/D24965



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to