aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2024-03-15 21:53:37 +0100
committerSam McCall <sam.mccall@gmail.com>2024-03-15 21:55:37 +0100
commitca4c4a6758d184f209cb5d88ef42ecc011b11642 (patch)
tree26a54c9b191abc5733e8327512b57f3955b8e346 /clang/lib/CodeGen/CodeGenFunction.cpp
parenta4610c7182d35093e9e0fde5be91659a8b9da5b8 (diff)
downloadllvm-ca4c4a6758d184f209cb5d88ef42ecc011b11642.zip
llvm-ca4c4a6758d184f209cb5d88ef42ecc011b11642.tar.gz
llvm-ca4c4a6758d184f209cb5d88ef42ecc011b11642.tar.bz2
Revert "[clang][nullability] allow _Nonnull etc on nullable class types (#82705)"
This reverts commit 92a09c0165b87032e1bd05020a78ed845cf35661. This is triggering a bunch of new -Wnullability-completeness warnings in code with existing raw pointer nullability annotations. The intent was the new nullability locations wouldn't affect those warnings, so this is a bug at least for now.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 8e4dc89..4a3ff49 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -979,8 +979,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
// return value. Initialize the flag to 'true' and refine it in EmitParmDecl.
if (SanOpts.has(SanitizerKind::NullabilityReturn)) {
auto Nullability = FnRetTy->getNullability();
- if (Nullability && *Nullability == NullabilityKind::NonNull &&
- !FnRetTy->isRecordType()) {
+ if (Nullability && *Nullability == NullabilityKind::NonNull) {
if (!(SanOpts.has(SanitizerKind::ReturnsNonnullAttribute) &&
CurCodeDecl && CurCodeDecl->getAttr<ReturnsNonNullAttr>()))
RetValNullabilityPrecondition =