diff options
author | Sam McCall <sam.mccall@gmail.com> | 2024-04-02 13:48:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-02 13:48:45 +0200 |
commit | 7ef602b58c1ccacab20d9d01e24b281458c3facc (patch) | |
tree | 766f8fa5aa7887f9bebf8ce12ca1365a68573c48 /clang/lib/CodeGen/CGCall.cpp | |
parent | 0b13e2c82315eac8926f1c4497c4d56a507c3999 (diff) | |
download | llvm-7ef602b58c1ccacab20d9d01e24b281458c3facc.zip llvm-7ef602b58c1ccacab20d9d01e24b281458c3facc.tar.gz llvm-7ef602b58c1ccacab20d9d01e24b281458c3facc.tar.bz2 |
Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)" (#87325)
This reverts commit 28760b63bbf9e267713957105a8d17091fb0d20e.
The last commit was missing the new testcase, now fixed.
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 9308528..f12765b 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4379,7 +4379,8 @@ void CodeGenFunction::EmitNonNullArgCheck(RValue RV, QualType ArgType, NNAttr = getNonNullAttr(AC.getDecl(), PVD, ArgType, ArgNo); bool CanCheckNullability = false; - if (SanOpts.has(SanitizerKind::NullabilityArg) && !NNAttr && PVD) { + if (SanOpts.has(SanitizerKind::NullabilityArg) && !NNAttr && PVD && + !PVD->getType()->isRecordType()) { auto Nullability = PVD->getType()->getNullability(); CanCheckNullability = Nullability && *Nullability == NullabilityKind::NonNull && |