aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
authorYounan Zhang <zyn7109@gmail.com>2025-02-26 15:34:06 +0800
committerGitHub <noreply@github.com>2025-02-26 15:34:06 +0800
commit2015626783aa7510ccdf6098f2112417cf56a8d0 (patch)
tree7289b5c0c3aa2a54cf2b45b8805ad56a2ce13100 /clang/lib/Sema/SemaConcept.cpp
parent29c5e4289f53a8abf0ffffb7074d2af2d4d0a26b (diff)
downloadllvm-2015626783aa7510ccdf6098f2112417cf56a8d0.zip
llvm-2015626783aa7510ccdf6098f2112417cf56a8d0.tar.gz
llvm-2015626783aa7510ccdf6098f2112417cf56a8d0.tar.bz2
[Clang] Implement CWG2918 'Consideration of constraints for address of overloaded function' (#127773)
Closes https://github.com/llvm/llvm-project/issues/122523
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index a7b609f..57dc415 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1796,6 +1796,7 @@ bool Sema::IsAtLeastAsConstrained(NamedDecl *D1,
NamedDecl *D2,
MutableArrayRef<const Expr *> AC2,
bool &Result) {
+#ifndef NDEBUG
if (const auto *FD1 = dyn_cast<FunctionDecl>(D1)) {
auto IsExpectedEntity = [](const FunctionDecl *FD) {
FunctionDecl::TemplatedKind Kind = FD->getTemplatedKind();
@@ -1803,13 +1804,11 @@ bool Sema::IsAtLeastAsConstrained(NamedDecl *D1,
Kind == FunctionDecl::TK_FunctionTemplate;
};
const auto *FD2 = dyn_cast<FunctionDecl>(D2);
- (void)IsExpectedEntity;
- (void)FD1;
- (void)FD2;
assert(IsExpectedEntity(FD1) && FD2 && IsExpectedEntity(FD2) &&
"use non-instantiated function declaration for constraints partial "
"ordering");
}
+#endif
if (AC1.empty()) {
Result = AC2.empty();