This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix false-positive in cppcoreguidelines-slicing
ClosedPublic

Authored by PiotrZSL on Feb 16 2023, 10:55 AM.

Details

Summary

When warning would be emitted in constructor for virtual base class
initialization.

Fixes: https://github.com/llvm/llvm-project/issues/31187

Diff Detail

Event Timeline

PiotrZSL created this revision.Feb 16 2023, 10:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
PiotrZSL published this revision for review.Feb 16 2023, 12:43 PM

Ready for review.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 12:43 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
PiotrZSL updated this revision to Diff 503082.Mar 7 2023, 9:59 AM

Ping, Rebase

PiotrZSL updated this revision to Diff 503287.Mar 8 2023, 2:52 AM

Rebase due to broken baseline

Looks good, just a small comment!

clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/slicing.cpp
102

Please briefly document this test case, i.e. why in this case this is not considered slicing and the check should not warn. It would be good to also mention the Github issue for traceability.

PiotrZSL updated this revision to Diff 504377.Mar 11 2023, 9:10 AM
PiotrZSL marked an inline comment as done.

Review comments fix

This comment was removed by PiotrZSL.
carlosgalvezp accepted this revision.Mar 11 2023, 9:21 AM

LGTM, thanks for the fix!

This revision is now accepted and ready to land.Mar 11 2023, 9:21 AM