[analyzer] Track trivial copy/move constructors and initializer lists in the BugReporter
authorisuckatcs <65320245+isuckatcs@users.noreply.github.com>
Thu, 18 Aug 2022 08:52:16 +0000 (10:52 +0200)
committerisuckatcs <65320245+isuckatcs@users.noreply.github.com>
Mon, 5 Sep 2022 15:06:27 +0000 (17:06 +0200)
commita11e51e91f73e413eb044bc0b2f2e205735618d7
tree2edce99a906d1bed8a3d40a26b69492b14d8b9eb
parent511f2169a8f12a0892ed5350becf02f45ab3dc17
[analyzer] Track trivial copy/move constructors and initializer lists in the BugReporter

If an object has a trivial copy/move constructor, it's not inlined
on invocation but a trivial copy is performed instead. This patch
handles trivial copies in the bug reporter by matching the field
regions of the 2 objects involved in the copy/move construction,
and tracking the appropriate region further. This patch also
introduces some support for tracking values in initializer lists.

Differential Revision: https://reviews.llvm.org/D131262
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/test/Analysis/ctor-bug-path.cpp [new file with mode: 0644]