[NFCI] Always initialize BugReport const fields

Summary:
Some compilers require that const fields of an object must be explicitly
initialized by the constructor. I ran into this issue building with clang
3.8 on Ubuntu 16.04.

Reviewers: compnerd, Szelethus, NoQ

Subscribers: cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 368950
This commit is contained in:
Alex Langford 2019-08-15 00:58:51 +00:00
parent efe0093404
commit 0630bbc7fe
1 changed files with 4 additions and 2 deletions

View File

@ -180,10 +180,12 @@ public:
/// to the user. This method allows to rest the location which should be used
/// for uniquing reports. For example, memory leaks checker, could set this to
/// the allocation site, rather then the location where the bug is reported.
BugReport(BugType& bt, StringRef desc, const ExplodedNode *errornode,
BugReport(BugType &bt, StringRef desc, const ExplodedNode *errornode,
PathDiagnosticLocation LocationToUnique, const Decl *DeclToUnique)
: BT(bt), Description(desc), UniqueingLocation(LocationToUnique),
UniqueingDecl(DeclToUnique), ErrorNode(errornode) {}
UniqueingDecl(DeclToUnique), ErrorNode(errornode),
ErrorNodeRange(getStmt() ? getStmt()->getSourceRange()
: SourceRange()) {}
virtual ~BugReport() = default;