C++ Logo

std-proposals

Advanced search

Re: Poisoned initializers

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Sat, 12 Jun 2021 16:08:22 +0200
Il 12/06/21 15:05, Ville Voutilainen via Std-Proposals ha scritto:
> template <class T> remove_cvref_t<T> unsanitize(T&& t);
>
> Returns: Either t or an unspecified value. If an unspecified value is
> returned, the value and copies of the
> value may be treated as indeterminate values until a subsequent
> assignment or bitwise copy of a non-indeterminate
> value is performed to the storage location where such a result or copy
> of the result of unsanitize() is stored.

Basically the problemâ„¢ today would be that an implementation such as

> #if defined(__has_feature) && __has_feature(memory_sanitizer)
> T x;
> return x;
> #else
> return std::forward<T>(t);
> #endif

would make MSAN trip on the return itself? (Didn't try on a complete
testcase...)

Thanks,
-- 
Giuseppe D'Angelo | giuseppe.dangelo_at_[hidden] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Received on 2021-06-12 09:08:37