[Lookup] Invisible decls should not be ambiguous when renaming.
authorEric Liu <ioeric@google.com>
Mon, 15 Apr 2019 08:46:34 +0000 (08:46 +0000)
committerEric Liu <ioeric@google.com>
Mon, 15 Apr 2019 08:46:34 +0000 (08:46 +0000)
commitdc8d8fb20b88f7b7699427828cf998aa5fc2c981
tree37f181088c7af47996e86d39dbcc0fa495edf76b
parent42605f83d3eede439a58e31a229733b07c003026
[Lookup] Invisible decls should not be ambiguous when renaming.

Summary:
For example, a renamed type in a header file can conflict with declaration in
a random file that includes the header, but we should not consider the decl ambiguous if
it's not visible at the rename location. This improves consistency of generated replacements
when header file is included in different TUs.

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 358378
clang/include/clang/Tooling/Core/Lookup.h
clang/lib/Tooling/Core/Lookup.cpp
clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp
clang/unittests/Tooling/LookupTest.cpp