This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-convert` check.
ClosedPublic

Authored by hokein on Mar 14 2016, 4:25 AM.

Details

Summary

Fix assertion failure: "Name is not a simple identifier".

Decl::GetName assumes the name should be an identifier. When the check
processes the function calling statement with speciail key name like
'it.operator->()', it will trigger the assert in GetName.

Rather than using Decl::GetName, we use getNameAsString which works
with special key names in C++.

Diff Detail

Event Timeline

hokein updated this revision to Diff 50580.Mar 14 2016, 4:25 AM
hokein retitled this revision from to [clang-tidy] Fix an assertion failure in `modernize-loop-convert`.
hokein updated this object.
hokein retitled this revision from [clang-tidy] Fix an assertion failure in `modernize-loop-convert` to [clang-tidy] Fix "Name is not a simple identifier" assertion in `modernize-loop-convert` check..Mar 14 2016, 4:27 AM
hokein added a reviewer: bkramer.
hokein set the repository for this revision to rL LLVM.
hokein added a subscriber: cfe-commits.
bkramer accepted this revision.Mar 14 2016, 4:41 AM
bkramer edited edge metadata.

looks good.

This revision is now accepted and ready to land.Mar 14 2016, 4:41 AM
This revision was automatically updated to reflect the committed changes.