From 2ae39902506f38d6368a7dbe3d64109f57ad6f99 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Tue, 28 Feb 2023 19:36:56 +0100 Subject: [PATCH] Revert "[Modules] Don't check [temp.friend]p9 in ASTContext::isSameEntity" This commits breaks the libc++ modular build in the precommit CI. This reverts commit 74565c3add6d683559618973863e78a5e6836e48. --- clang/lib/AST/ASTContext.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 00b339f..b692e6e 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6707,6 +6707,10 @@ bool ASTContext::isSameEntity(const NamedDecl *X, const NamedDecl *Y) const { PrimaryY->getTrailingRequiresClause())) return false; + // Constrained friends are different in certain cases, see: [temp.friend]p9. + if (FriendsDifferByConstraints(FuncX, FuncY)) + return false; + auto GetTypeAsWritten = [](const FunctionDecl *FD) { // Map to the first declaration that we've already merged into this one. // The TSI of redeclarations might not match (due to calling conventions -- 2.7.4