HomePhabricator

[analyzer] UndefinedAssignmentChecker: Better warning message in implicit ctors.

Description

[analyzer] UndefinedAssignmentChecker: Better warning message in implicit ctors.

When a class forgets to initialize a field in the constructor, and then gets
copied around, a warning is emitted that the value assigned to a specific field
is undefined.

When the copy/move constructor is implicit (not written out in the code) but not
trivial (is not a trivial memory copy, eg. because members have an explicit copy
constructor), the body of such constructor is auto-generated in the AST.
In this case the checker's warning message is squeezed at the top of
the class declaration, and it gets hard to guess which field is at fault.

Fix the warning message to include the name of the field.

Differential Revision: https://reviews.llvm.org/D43798

Details

Committed
NoQFeb 27 2018, 2:05 PM
Differential Revision
D43798: [analyzer] UndefinedAssignment: Fix warning message on implicit copy/move constructors.
Branches
Unknown
Tags
Unknown