Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 965 Bytes

File metadata and controls

13 lines (11 loc) · 965 Bytes
title C26401
ms.date 07/21/2017
ms.topic conceptual
f1_keywords
C26401
helpviewer_keywords
C26401
ms.assetid b9d3d398-697a-4a5d-8bfe-9c667dffb90b

C26401 DONT_DELETE_NON_OWNER

This check detects places where moving to owner<T> can be a good option for the first stage of refactoring. Like C26400 it enforces rules I.11 and R.3, but focuses on the "release" portion of the pointer lifetime. It warns on any call to operator delete if its target is neither an owner<T> nor an implicitly assumed owner. For more information, see C26400 regarding the auto declarations. This does include expressions that refer to global variables, formals, and so on.

Warnings C26400 and C26401 always occur with C26409, but they are more appropriate for scenarios where immediate migration to smart pointers is not feasible. In such cases the owner<T> concept can be adopted first and C26409 may be temporarily suppressed.