Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-tidy] Make MatchesAnyListedNameMatcher cope with unnamed Decl
If MatchesAnyListedNameMatcher::NameMatcher::match() is called in MatchMode::MatchUnqualified mode with a NamedDecl that has no name then calling NamedDecl::getName() will assert with: `Name.isIdentifier() && "Name is not a simple identifier"' It seems unfair to force all matchers using matchers::matchesAnyListedName to defend against this, particularly since test cases are unlikely to provoke the problem. Let's just check whether the identifier has a name before attempting to use it instead. Add test case that reproduces the problem to the use-std-print-custom.cpp lit check. Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D154884
- Loading branch information