Skip to content

Commit 74565c3

Browse files
committed
[Modules] Don't check [temp.friend]p9 in ASTContext::isSameEntity
[temp.friend]p9 says > Such a constrained friend function or function template declaration does not declare the same function or function template as a declaration in any other scope. But the friend declaration in the same scope shouldn't fall into this catagory. Although the logic is handled in 'FriendsDifferByConstraints', the compiler may haven't merged the lexcial declcontext in time. Also the code removed is not covered by test too. Let's handle the logic in sema as we've done now.
1 parent 48027f0 commit 74565c3

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6687,10 +6687,6 @@ bool ASTContext::isSameEntity(const NamedDecl *X, const NamedDecl *Y) const {
66876687
FuncY->getTrailingRequiresClause()))
66886688
return false;
66896689

6690-
// Constrained friends are different in certain cases, see: [temp.friend]p9.
6691-
if (FriendsDifferByConstraints(FuncX, FuncY))
6692-
return false;
6693-
66946690
auto GetTypeAsWritten = [](const FunctionDecl *FD) {
66956691
// Map to the first declaration that we've already merged into this one.
66966692
// The TSI of redeclarations might not match (due to calling conventions

0 commit comments

Comments
 (0)