forked from OSchip/llvm-project
[modules] Fix crash when writing an update record for a redeclaration of an empty namespace.
llvm-svn: 241732
This commit is contained in:
parent
13e20f1bbf
commit
696e812bb3
|
@ -1016,10 +1016,12 @@ void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) {
|
|||
StoredDeclsMap *Map = NS->buildLookup();
|
||||
SmallVector<std::pair<DeclarationName, DeclContext::lookup_result>, 16>
|
||||
LookupResults;
|
||||
LookupResults.reserve(Map->size());
|
||||
for (auto &Entry : *Map)
|
||||
LookupResults.push_back(
|
||||
std::make_pair(Entry.first, Entry.second.getLookupResult()));
|
||||
if (Map) {
|
||||
LookupResults.reserve(Map->size());
|
||||
for (auto &Entry : *Map)
|
||||
LookupResults.push_back(
|
||||
std::make_pair(Entry.first, Entry.second.getLookupResult()));
|
||||
}
|
||||
|
||||
std::sort(LookupResults.begin(), LookupResults.end(), llvm::less_first());
|
||||
for (auto &NameAndResult : LookupResults) {
|
||||
|
|
|
@ -71,3 +71,5 @@ namespace N12 {
|
|||
}
|
||||
Foo *getFoo();
|
||||
}
|
||||
|
||||
namespace Empty {}
|
||||
|
|
|
@ -66,3 +66,5 @@ namespace N12 {
|
|||
}
|
||||
void consumeFoo(Foo*);
|
||||
}
|
||||
|
||||
namespace Empty {}
|
||||
|
|
|
@ -21,3 +21,5 @@ namespace N13 {
|
|||
namespace AddAndReexportBeforeImport {
|
||||
int S;
|
||||
}
|
||||
|
||||
namespace Empty {}
|
||||
|
|
Loading…
Reference in New Issue