From 42e13ea4bff4eafb46d16942436b89e166f9d844 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 16 Mar 2022 12:25:44 +0100 Subject: Cleanup: Deprecated field access in outliner_duplicate Solved by introducing introducing a variant of MEM_cnew which behaves as a copy-constructor for a trivial types. Alternative approach would be to surround DNA structs with clang/gcc diagnostics push/modify/pop so that implicitly defined constructors and copy operators are allowed to access deprecated fields. The downside of the DNA approach is that it will require some way to easily apply diagnostics modifications to many structs, which is not possible currently. The newly added MEM_cnew has other good usecases, so is easiest to use this route, at least for now. Differential Revision: https://developer.blender.org/D14356 --- source/blender/editors/space_outliner/space_outliner.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner/space_outliner.cc') diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index f75182d25a0..97dc659155f 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -371,7 +371,7 @@ static void outliner_init(wmWindowManager *UNUSED(wm), ScrArea *area) static SpaceLink *outliner_duplicate(SpaceLink *sl) { SpaceOutliner *space_outliner = (SpaceOutliner *)sl; - SpaceOutliner *space_outliner_new = MEM_new(__func__, *space_outliner); + SpaceOutliner *space_outliner_new = MEM_cnew(__func__, *space_outliner); BLI_listbase_clear(&space_outliner_new->tree); space_outliner_new->treestore = nullptr; -- cgit v1.2.3