[clang] Add unique_ptr <T[]> accesses to -Wunsafe-buffer-usage (PR #156773)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 16 10:18:04 PDT 2025


================
@@ -1318,6 +1319,105 @@ static bool isSupportedVariable(const DeclRefExpr &Node) {
   return D != nullptr && isa<VarDecl>(D);
 }
 
+static bool isUniquePtrArray(const CXXRecordDecl *RecordDecl) {
+  if (!RecordDecl || !RecordDecl->isInStdNamespace() ||
+      RecordDecl->getNameAsString() != "unique_ptr") {
----------------
shreya-jain wrote:

Thanks, fixed here and in other places.

https://github.com/llvm/llvm-project/pull/156773


More information about the cfe-commits mailing list