From 808d30468769a4073e2a8aae0f8bab6bc0930f2d Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Mon, 30 Jan 2017 06:24:16 -0500 Subject: [PATCH] C.127 should not claim that there is a defined behavior --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f4caec2..4e2cfc1 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -6077,7 +6077,7 @@ A class with a virtual function is usually (and in general) used via a pointer t // ... no user-written destructor, defaults to public nonvirtual ... }; - // bad: class with a resource derived from a class without a virtual destructor + // bad: derived from a class without a virtual destructor struct D : B { string s {"default"}; }; @@ -6086,7 +6086,7 @@ A class with a virtual function is usually (and in general) used via a pointer t { auto p = make_unique(); // ... - } // calls B::~B only, leaks the string + } // undefined behavior. May call B::~B only and leak the string ##### Note