From 8d6caad58646e08a47e96c2a458a6c18058672c9 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 21 Sep 2021 11:16:39 +0200 Subject: [PATCH] Disable sanity check in StoredDeclsList for SEL typedefs --- clang/include/clang/AST/DeclContextInternals.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clang/include/clang/AST/DeclContextInternals.h b/clang/include/clang/AST/DeclContextInternals.h index 2eef2343b7500..0df2cd1e6d68c 100644 --- a/clang/include/clang/AST/DeclContextInternals.h +++ b/clang/include/clang/AST/DeclContextInternals.h @@ -238,7 +238,13 @@ class StoredDeclsList { // FIXME: Move the assert before the single decl case when we fix the // duplication coming from the ASTReader reading builtin types. - assert(!llvm::is_contained(getLookupResult(), D) && "Already exists!"); + assert((!llvm::is_contained(getLookupResult(), D) || +// Swift mod: Work around an issue where the SEL type is also contained twice +// in the AST constructed by the ASTImporter and SwiftDWARFImporter. See +// rdar://82037935 + (D->getIdentifier() && D->getIdentifier()->isStr("SEL"))) +// End Swift mod + && "Already exists!"); // Determine if this declaration is actually a redeclaration. for (DeclListNode *N = getAsList(); /*return in loop*/; N = N->Rest.dyn_cast()) {