[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 20 03:22:06 PDT 2024
================
@@ -344,9 +347,11 @@ static void handleGslAnnotatedTypes(IndirectLocalPath &Path, Expr *Call,
break;
}
}
- Path.push_back({Value ? IndirectLocalPathEntry::GslPointerInit
- : IndirectLocalPathEntry::GslReferenceInit,
- Arg, D});
+
+ Path.push_back({!ReturnType->isReferenceType()
+ ? IndirectLocalPathEntry::GslPointerInit
+ : IndirectLocalPathEntry::GslReferenceInit,
----------------
usx95 wrote:
nit: simplify without `!`
`ReturnType->isReferenceType() ? IndirectLocalPathEntry::GslReferenceInit: IndirectLocalPathEntry::GslPointerInit`
https://github.com/llvm/llvm-project/pull/104556
More information about the cfe-commits
mailing list