[clang-rename] NFC, make getCanonicalSymbolDeclaration robust on nullptr input.

This commit is contained in:
Haojian Wu 2019-10-25 14:22:21 +02:00
parent ce1e249a68
commit 3d9632a997
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ namespace clang {
namespace tooling {
const NamedDecl *getCanonicalSymbolDeclaration(const NamedDecl *FoundDecl) {
if (!FoundDecl)
return nullptr;
// If FoundDecl is a constructor or destructor, we want to instead take
// the Decl of the corresponding class.
if (const auto *CtorDecl = dyn_cast<CXXConstructorDecl>(FoundDecl))