Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent deleting duplicate nested forward decls
fix_includes.py could be over-zealous and delete forward declarations of nested classes if they happened to share a name with another nested class in the same file. This was because the analysis of top-level spans detected #ifdefs and namespaces, but not classes as things which made code non-top-level. Luckily, the IWYU output makes it obvious when a forward declaration is for a nested class. Take advantage of that to fix this bug. Also, add a regression test.
- Loading branch information
Showing
2 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters