This fixes a bug where namespace scopes were being searched before template parameter scopes.
Delay searching namespace/file scopes in Sema::CppLookupName until all local scopes are searched.
Paths
| Differential D147283
[Sema] Search template parameter scopes before searching namespace/file scopes when performing unqualified name lookup Needs ReviewPublic Authored by ahatanak on Mar 30 2023, 3:57 PM.
Details
Summary This fixes a bug where namespace scopes were being searched before template parameter scopes. Delay searching namespace/file scopes in Sema::CppLookupName until all local scopes are searched.
Diff Detail
Event TimelineComment Actions
Revision Contents
Diff 509828 clang/lib/Sema/SemaLookup.cpp
clang/test/SemaCXX/namespace.cpp
|
I noticed that we aren't visiting the contexts from the inside out despite the comment here: https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaLookup.cpp#L133
But I think that's OK. I haven't been able to come up with an example where this is causing a problem.