[libcxx-commits] [PATCH] D82627: Fix CFI issues in <future>

Evgenii Stepanov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 16 13:26:20 PDT 2020


eugenis added a subscriber: HAPPY.
eugenis added a comment.

@HAPPY 
I'm not an expert, but I've heard that such casts are UB somewhere.
Looking at  [basic.life] 6.8/6 in c++17

> Before the lifetime of an object has started but after the storage which the object will occupy has been allocated [...] any pointer that represents the address of the storage location where the object will be or was located may be used but only in limited ways. [...] 
>  The program has undefined behavior if:
>  [...]
> 
> - the pointer is used as the operand of a static_cast (8.2.9), except when the conversion is to pointer to cv void, or to pointer to cv void and subsequently to pointer to cv char, cv unsigned char, or cv std::byte (21.2.1),[...]




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82627/new/

https://reviews.llvm.org/D82627





More information about the libcxx-commits mailing list