HomePhabricator

[clang-tidy] Fix null pointer dereference in readability-identifier-naming

Authored by hokein on May 28 2019, 4:54 AM.

Description

[clang-tidy] Fix null pointer dereference in readability-identifier-naming

Summary:
readability-identifier-naming causes a null pointer dereference when checking an identifier introduced by a structured binding whose right hand side is an undeclared identifier.

Running the check on a file that is just the following results in a crash:

auto [left] = right;

Patch by Mark Stegeman!

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: hokein, aaron.ballman

Subscribers: madsravn, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 361809