Fix handling of module imports adding names to a DeclContext after qualified
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Feb 2013 03:37:08 +0000 (03:37 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 7 Feb 2013 03:37:08 +0000 (03:37 +0000)
commit645d755d3e40bfb57f19ab7c474b832b71f3b095
tree31de144326a7759ce327c929fc73bc40c836bf80
parent9ce12e36abf44b6373b88610f3c73fbbbdee9b36
Fix handling of module imports adding names to a DeclContext after qualified
name lookup has been performed in that context (this probably only happens in
C++).

1) Whenever we add names to a context, set a flag on it, and if we perform
lookup and discover that the context has had a lookup table built but has the
flag set, update all entries in the lookup table with additional names from
the external source.

2) When marking a DeclContext as having external visible decls, mark the
context in which lookup is performed, not the one we are adding. These won't
be the same if we're adding another copy of a pre-existing namespace.

llvm-svn: 174577
clang/include/clang/AST/DeclBase.h
clang/include/clang/AST/DeclContextInternals.h
clang/lib/AST/DeclBase.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
clang/test/Modules/Inputs/namespaces-left.h
clang/test/Modules/Inputs/namespaces-right.h
clang/test/Modules/namespaces.cpp