diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-03-27 21:40:58 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-03-27 21:40:58 +0000 |
| commit | f089372c5cff0ff37931e5f1b2cb20bbebf15ae1 (patch) | |
| tree | 5fc89e6df0714037ab8b131866aef46db7a37586 | |
| parent | df5bf99d0b0dbc9e676ffff88f3c24524e623fd1 (diff) | |
| download | bcm5719-llvm-f089372c5cff0ff37931e5f1b2cb20bbebf15ae1.tar.gz bcm5719-llvm-f089372c5cff0ff37931e5f1b2cb20bbebf15ae1.zip | |
[Modules] Work around PR23030 again, in a different code path, where
I again added the "reasonable" assertions and they again fired during
a modules self-host.
This hopefully will un-break the self-host build bot. No test case handy
and adding one seems to have little or no value really.
llvm-svn: 233426
| -rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 3632672e37b..608aa598cf4 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -994,13 +994,16 @@ void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) { std::sort(LookupResults.begin(), LookupResults.end(), llvm::less_first()); for (auto &NameAndResult : LookupResults) { DeclarationName Name = NameAndResult.first; - (void)Name; - assert(Name.getNameKind() != DeclarationName::CXXConstructorName && - "Cannot have a constructor name in a namespace!"); - assert(Name.getNameKind() != DeclarationName::CXXConversionFunctionName && - "Cannot have a conversion function name in a namespace!"); - DeclContext::lookup_result Result = NameAndResult.second; + if (Name.getNameKind() == DeclarationName::CXXConstructorName || + Name.getNameKind() == DeclarationName::CXXConversionFunctionName) { + // We have to work around a name lookup bug here where negative lookup + // results for these names get cached in namespace lookup tables. + assert(Result.empty() && "Cannot have a constructor or conversion " + "function name in a namespace!"); + continue; + } + for (NamedDecl *ND : Result) Writer.GetDeclRef(ND); } |

