This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix an assertion failure in cppcoreguidelines-pro-type-member-init.
ClosedPublic

Authored by hokein on Oct 18 2016, 1:37 PM.

Details

Summary

The matcher for matching "class with default constructor" still match
some classes without default constructor, which trigger an assert at
Line 307. This patch makes the matcher more strict.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 75066.Oct 18 2016, 1:37 PM
hokein retitled this revision from to [clang-tidy] Fix an assertion failure in cppcoreguidelines-pro-type-member-init..
hokein updated this object.
hokein added a reviewer: aaron.ballman.
hokein added a subscriber: cfe-commits.
aaron.ballman accepted this revision.Oct 20 2016, 6:20 AM
aaron.ballman edited edge metadata.

LGTM

clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
30 ↗(On Diff #75066)

I think this should be a public AST matcher rather than a private one; it seems like it would be generally useful (along with some of the other similar has* functions). However, I think it's fine for this patch.

This revision is now accepted and ready to land.Oct 20 2016, 6:20 AM
hokein added inline comments.Oct 20 2016, 6:22 AM
clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
30 ↗(On Diff #75066)

+1, will do it in a follow-up.

This revision was automatically updated to reflect the committed changes.