Fix invalid casts in <functional>.

static_cast of a pointer to object before the start of the object's
lifetime has undefined behavior.

This code triggers CFI warnings.

This change replaces C-style casts with reinterpret_cast, which is
fine per the standard, add applies an attribute to silence CFI (which
barks on reinterpret_cast, too).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260441 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed