C++ modules: fix a bug where loading a declaration with some name would prevent
name lookup from lazily deserializing the other declarations with the same name, by tracking a bit to indicate whether a name in a DeclContext might have additional external results. This also allows lazier reconciling of the lookup table if a module import adds decls to a pre-existing DC. However, this exposes a pre-existing bug, which causes a regression in test/Modules/decldef.mm: if we have a reference to a declaration, and a later-imported module adds a redeclaration, nothing causes us to load that redeclaration when we use or emit the reference (which can manifest as a reference to an undefined inline function, a use of an incomplete type, and so on). decldef.mm has been extended with an additional testcase which fails with or without this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190293 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/AST/DeclContextInternals.h 39 additions, 9 deletionsinclude/clang/AST/DeclContextInternals.h
- lib/AST/DeclBase.cpp 20 additions, 14 deletionslib/AST/DeclBase.cpp
- lib/Sema/SemaType.cpp 8 additions, 0 deletionslib/Sema/SemaType.cpp
- test/Modules/Inputs/def.h 7 additions, 0 deletionstest/Modules/Inputs/def.h
- test/Modules/Inputs/namespaces-top.h 5 additions, 0 deletionstest/Modules/Inputs/namespaces-top.h
- test/Modules/cxx-templates.cpp 0 additions, 3 deletionstest/Modules/cxx-templates.cpp
- test/Modules/decldef.mm 8 additions, 2 deletionstest/Modules/decldef.mm
- test/Modules/namespaces.cpp 7 additions, 0 deletionstest/Modules/namespaces.cpp
Loading
Please register or sign in to comment