This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix bugprone-argument-comment-check to correctly ignore implicit constructors.
ClosedPublic

Authored by ymandel on Sep 18 2019, 7:30 PM.

Details

Summary

After revision 370919, this check incorrectly flags certain cases of implicit
constructors. Specifically, if an argument is annotated with an
argument-comment and the argument expression triggers an implicit constructor,
then the argument comment is associated with argument of the implicit
constructor.

However, this only happens when the constructor has more than one argument.
This revision fixes the check for implicit constructors and adds a regression
test for this case.

Note: r370919 didn't cause this bug, it simply uncovered it by fixing another
bug that was masking the behavior.

Diff Detail

Repository
rL LLVM

Event Timeline

ymandel created this revision.Sep 18 2019, 7:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2019, 7:30 PM
Herald added a subscriber: xazax.hun. · View Herald Transcript
gribozavr accepted this revision.Sep 19 2019, 5:24 AM

Thanks for the fix!

This revision is now accepted and ready to land.Sep 19 2019, 5:24 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2019, 6:13 AM