This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Ignore implicit casts in modernize-use-default-member-init
ClosedPublic

Authored by malcolm.parsons on Jan 13 2020, 9:13 AM.

Details

Summary

Initialising a pointer from nullptr involves an implicit cast.
Ignore it after getting initialiser from InitListExpr.

Fixes: PR44440

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2020, 9:13 AM
JonasToth accepted this revision.Jan 13 2020, 1:23 PM

LGTM in general. The linked bug report misses a "4" --> PR44440, so please the description for that.

clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init.cpp
294

are those related to this patch?

This revision is now accepted and ready to land.Jan 13 2020, 1:23 PM
malcolm.parsons edited the summary of this revision. (Show Details)Jan 13 2020, 1:59 PM
malcolm.parsons marked 2 inline comments as done.Jan 13 2020, 2:02 PM
malcolm.parsons added inline comments.
clang-tools-extra/test/clang-tidy/checkers/modernize-use-default-member-init.cpp
294

Yes - checking that this style of initialisation works in all cases.

K. Thank you for fixing it!

This revision was automatically updated to reflect the committed changes.
malcolm.parsons marked an inline comment as done.
hans added a subscriber: hans.Jan 16 2020, 2:14 AM

It seems that while this commit got pushed to GitHub, it's not actually part of master or any other branches.

It seems that while this commit got pushed to GitHub, it's not actually part of master or any other branches.

This was my first push to llvm's GitHub repository, so I may have done something wrong.

The changeset looks like it's in master to me:

$ git branch -r --contains 45924eb
  origin/HEAD -> origin/master
  origin/master
  origin/release/10.x
hans added a comment.Jan 24 2020, 9:32 AM

Ah, you're right, it's there.

The reason for my comment was http://lists.llvm.org/pipermail/llvm-branch-commits/2020-January/013555.html but it seems it was also successfully pushed to master. Sorry for the noise.