aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2024-03-28 22:45:55 +0100
committerSam McCall <sam.mccall@gmail.com>2024-03-28 23:57:09 +0100
commitbbbcc1d99d08855069f4501c896c43a6d4d7b598 (patch)
treefbe29ac3a9d9f1009f0418ce44c8d164b1cad0cc /clang/lib/CodeGen/CGCall.cpp
parenteee8c6150a1c3af54542d34d1c084a86feda4d96 (diff)
downloadllvm-bbbcc1d99d08855069f4501c896c43a6d4d7b598.zip
llvm-bbbcc1d99d08855069f4501c896c43a6d4d7b598.tar.gz
llvm-bbbcc1d99d08855069f4501c896c43a6d4d7b598.tar.bz2
Reapply "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)"
This reverts commit ca4c4a6758d184f209cb5d88ef42ecc011b11642. This was intended not to introduce new consistency diagnostics for smart pointer types, but failed to ignore sugar around types when detecting this. Fixed and test added.
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index a5fe396..4a4426d 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 &&