llvm-project/clang-tools-extra/include-fixer
Haojian Wu adedac68dc [include-fixer] Correct nested class search for identifiers with scoped information
Summary:
include-fixer will firstly try to use scoped namespace context information to
search identifier. However, in some cases, it's unsafe to do nested class
search, because it might treat the identifier as a nested class of scoped
namespace.

Given the following code, and the symbol database only has two classes: "foo" and
"b::Bar".

    namespace foo { Bar t; }

Before getting fixing, include-fixer will never search "Bar" symbol.
Because it firstly tries to search "foo::Bar", there is no "Bar" in foo namespace,
then it finds "foo" in database finally. So it treats "Bar" is a nested class
of "foo".

Reviewers: bkramer

Subscribers: cfe-commits

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

llvm-svn: 277442
2016-08-02 10:43:10 +00:00
..
find-all-symbols [include-fixer] Add missing namespace qualifiers after inserting a missing header. 2016-07-08 09:10:29 +00:00
tool Changes related to new implementation of tooling::Replacements as class. 2016-08-01 10:16:39 +00:00
CMakeLists.txt [include-fixer] Pull out Context implementation code to a cpp file. 2016-07-08 13:11:38 +00:00
InMemorySymbolIndex.cpp [include-fixer] Simplify unittest code. 2016-05-13 15:17:17 +00:00
InMemorySymbolIndex.h [include-fixer] Simplify unittest code. 2016-05-13 15:17:17 +00:00
IncludeFixer.cpp [include-fixer] Correct nested class search for identifiers with scoped information 2016-08-02 10:43:10 +00:00
IncludeFixer.h [include-fixer] Add mising qualifiers to all instances of an unidentified symbol. 2016-07-21 13:47:09 +00:00
IncludeFixerContext.cpp [include-fixer] Correct nested class search for identifiers with scoped information 2016-08-02 10:43:10 +00:00
IncludeFixerContext.h [include-fixer] Add mising qualifiers to all instances of an unidentified symbol. 2016-07-21 13:47:09 +00:00
SymbolIndex.h [include-fixer] Rename XrefsDB to SymbolIndex. 2016-05-13 09:27:54 +00:00
SymbolIndexManager.cpp [include-fixer] Correct nested class search for identifiers with scoped information 2016-08-02 10:43:10 +00:00
SymbolIndexManager.h [include-fixer] Correct nested class search for identifiers with scoped information 2016-08-02 10:43:10 +00:00
YamlSymbolIndex.cpp [include-fixer] Rename XrefsDB to SymbolIndex. 2016-05-13 09:27:54 +00:00
YamlSymbolIndex.h [include-fixer] Rename XrefsDB to SymbolIndex. 2016-05-13 09:27:54 +00:00