I've come across with the `relaxed/strict pointer safety` concepts and that it is implementation defined whether an implementation has relaxed or strict pointer safety. My question is about modern implementations:
Does clang and g++ have strict or relaxed pointer safety?

I would like to clarify the following thing about strict pointer safety concept. There is a quote (sec. 3.7.4.3/4):

> 
> Alternatively, an implementation may have strict pointer safety, in
>  which case a pointer value referring to an object with dynamic storage
>  duration that is not a safely-derived pointer value is an invalid
>  pointer value unless the referenced complete object has previously
>  been declared reachable (20.7.4).
> 
> 
> 

That restriction is completely unclear for me. Moreover, I've tried to experiments with the concept with [cplusplus.com example](http://www.cplusplus.com/reference/memory/undeclare_reachable/)

```
// declare_reachable / undeclare_reachable example
#include <iostream>
#include <memory>
#include <cstdint>

int main() {
  int * p = new int (1);    // dynamic object

  std::declare_reachable(p);

  p = (int*)((std::uintptr_t)p ^ UINTPTR_MAX);  // scrambling p

  // dynamic object not reachable by any live safely-derived pointer

  p = std::undeclare_reachable((int*)((std::uintptr_t)p ^ UINTPTR_MAX));
  // p is back again a safely-derived pointer to the dynamic object

  std::cout << "p: " << *p << '\n';
  delete p;

  return 0;
}

```

The code even does not compile.

[demo](http://coliru.stacked-crooked.com/a/dd1a9a486c043959)