[PATCH] D113518: [clang] Create delegating constructors even in templates

Fabian Wolff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 10 13:23:31 PST 2021


fwolff marked 2 inline comments as done.
fwolff added a comment.

Thanks for your review @carlosgalvezp! I have addressed your inline comments. I'm not sure about the failing test, but it looks like a regression test internal to libFuzzer? Maybe it goes away with the rebuild.



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp:374
 {
   PositiveSelfInitialization() : PositiveSelfInitialization() {}
 };
----------------
carlosgalvezp wrote:
> Not really sure what this test is meant to do. Why would it call the destructor of the own class in it's own constructor? Looks very strange to me.
> 
> If anything, the constructor should call the constructor of the base:
> 
> PositiveSelfInitialization() : NegativeAggregateType()
> 
> What do you think?
The comment above talks about a "pathological template", so my guess is that this checks that clang-tidy doesn't crash for this input. The only reason why I had to touch this test at all is that the constructor is now treated as a delegating constructor, which suppresses the warning.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113518/new/

https://reviews.llvm.org/D113518



More information about the cfe-commits mailing list