aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/libclang/LibclangTest.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2023-06-28 10:31:38 +0100
committerJohn Brawn <john.brawn@arm.com>2023-07-25 12:30:41 +0100
commitd031ff38779bd688c514136dbdcce3169ee82b6e (patch)
treed0deeab0bc42e167c71d4648a3c885c394e62e87 /clang/unittests/libclang/LibclangTest.cpp
parente93ae281db0a4812e9121ad0a3dd6de551f46f91 (diff)
downloadllvm-d031ff38779bd688c514136dbdcce3169ee82b6e.zip
llvm-d031ff38779bd688c514136dbdcce3169ee82b6e.tar.gz
llvm-d031ff38779bd688c514136dbdcce3169ee82b6e.tar.bz2
[Sema] Fix handling of functions that hide classes
When a function is declared in the same scope as a class with the same name then the function hides that class. Currently this is done by a single check after the main loop in LookupResult::resolveKind, but this can give the wrong result when we have a using declaration in multiple namespace scopes in two different ways: * When the using declaration is hidden in one namespace but not the other we can end up considering only the hidden one when deciding if the result is ambiguous, causing an incorrect "not ambiguous" result. * When two classes with the same name in different namespace scopes are both hidden by using declarations this can result in incorrectly deciding the result is ambiguous. There's currently a comment saying this is expected, but I don't think that's correct. Solve this by checking each Decl to see if it's hidden by some other Decl in the same scope. This means we have to delay removing anything from Decls until after the main loop, in case a Decl is hidden by another that is removed due to being non-unique. Differential Revision: https://reviews.llvm.org/D154503
Diffstat (limited to 'clang/unittests/libclang/LibclangTest.cpp')
0 files changed, 0 insertions, 0 deletions