From 387a553e98d360a084fc5ece94e218cb22b7cc00 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 25 Dec 2016 20:09:24 +0100 Subject: [PATCH] Lib: fix warning regarding subobject-linkage And yes, this warning is for real, while the compiler has no way to decide if there is actual danger lurking. A type with internal linkage (e.g. defined in an anonymous namespace) will be treated by the linker as a separate entity on each encounter (i.e. in each distinct compilation unit). When multiple translation units start collaborating on such a type, they *might* be referring to different memory locations, while semantically the intention is to refer to the same location. And since we're dealing with a library facility here, *we* have likewise now power to ensure proper usage, so we better be cautious. --- src/lib/iter-stack.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/iter-stack.hpp b/src/lib/iter-stack.hpp index 6b42e0122..0bf5baa72 100644 --- a/src/lib/iter-stack.hpp +++ b/src/lib/iter-stack.hpp @@ -66,7 +66,7 @@ namespace lib { - namespace { + namespace iter { using util::unConst; /** @@ -100,7 +100,7 @@ namespace lib { elements.pop_back(); } }; - }//(End) Wrapper/Helper + } // namespace lib::iter @@ -118,7 +118,7 @@ namespace lib { */ template struct IterStack - : IterStateWrapper> + : IterStateWrapper> { // using default create and copy operations @@ -165,7 +165,7 @@ namespace lib { */ template struct IterQueue - : IterStateWrapper> + : IterStateWrapper> { // using default create and copy operations