Skip to content

Commit

Permalink
Revert "[C++20] [Modules] Trying to compare the trailing require clau…
Browse files Browse the repository at this point in the history
…se from the primary template function"

This reverts commit 9e50578. Since it
looks like this one prevents us to fix the modular build for libcxx.
  • Loading branch information
ChuanqiXu9 committed Mar 1, 2023
1 parent bc504e0 commit 5bb3253
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 104 deletions.
24 changes: 2 additions & 22 deletions clang/lib/AST/ASTContext.cpp
Expand Up @@ -6683,28 +6683,8 @@ bool ASTContext::isSameEntity(const NamedDecl *X, const NamedDecl *Y) const {
return false;
}

// The trailing require clause of instantiated function may change during
// the semantic analysis. Trying to get the primary template function (if
// exists) to compare the primary trailing require clause.
auto TryToGetPrimaryTemplatedFunction =
[](const FunctionDecl *FD) -> const FunctionDecl * {
switch (FD->getTemplatedKind()) {
case FunctionDecl::TK_DependentNonTemplate:
return FD->getInstantiatedFromDecl();
case FunctionDecl::TK_FunctionTemplate:
return FD->getDescribedFunctionTemplate()->getTemplatedDecl();
case FunctionDecl::TK_MemberSpecialization:
return FD->getInstantiatedFromMemberFunction();
case FunctionDecl::TK_FunctionTemplateSpecialization:
return FD->getPrimaryTemplate()->getTemplatedDecl();
default:
return FD;
}
};
const FunctionDecl *PrimaryX = TryToGetPrimaryTemplatedFunction(FuncX);
const FunctionDecl *PrimaryY = TryToGetPrimaryTemplatedFunction(FuncY);
if (!isSameConstraintExpr(PrimaryX->getTrailingRequiresClause(),
PrimaryY->getTrailingRequiresClause()))
if (!isSameConstraintExpr(FuncX->getTrailingRequiresClause(),
FuncY->getTrailingRequiresClause()))
return false;

auto GetTypeAsWritten = [](const FunctionDecl *FD) {
Expand Down
82 changes: 0 additions & 82 deletions clang/test/Modules/pr60890.cppm

This file was deleted.

0 comments on commit 5bb3253

Please sign in to comment.