aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorAmirreza Ashouri <ar.ashouri999@gmail.com>2023-10-11 18:42:15 +0330
committerGitHub <noreply@github.com>2023-10-11 17:12:15 +0200
commit4313351c135cc32cdf3b3fc3e44cf57f100a96ef (patch)
treef26f941b79697cefcd54b3b4d05f7dac8b2fb944 /clang/lib/CodeGen/CodeGenFunction.cpp
parent3bfc5eb97cff762dd71c8229a476419e6386e39f (diff)
downloadllvm-4313351c135cc32cdf3b3fc3e44cf57f100a96ef.zip
llvm-4313351c135cc32cdf3b3fc3e44cf57f100a96ef.tar.gz
llvm-4313351c135cc32cdf3b3fc3e44cf57f100a96ef.tar.bz2
[clang] __is_trivially_equality_comparable for types containing lambdas (#68506)
Lambdas (closure types) are trivially equality-comparable iff they are non-capturing, because non-capturing lambdas are convertible to function pointers: if (lam1 == lam2) compiles, then lam1 and lam2 must have the same type, and be always-equal, and be empty.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 9b21f42..4277719 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -1216,11 +1216,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
SkippedChecks.set(SanitizerKind::ObjectSize, true);
QualType ThisTy = MD->getThisType();
- // If this is the call operator of a lambda with no capture-default, it
+ // If this is the call operator of a lambda with no captures, it
// may have a static invoker function, which may call this operator with
// a null 'this' pointer.
- if (isLambdaCallOperator(MD) &&
- MD->getParent()->getLambdaCaptureDefault() == LCD_None)
+ if (isLambdaCallOperator(MD) && MD->getParent()->isCapturelessLambda())
SkippedChecks.set(SanitizerKind::Null, true);
EmitTypeCheck(