#include <iostream>
#include <type_traits>
using namespace std;
template<typename T>
void foo2(T&& val)
{
static_assert(std::is_same<int* const, T>::value, "not the same");
}
template<typename T>
void foo(T& val)
{
foo2(const_cast<T const>(val));
}
int main() {
int* bar;
foo(bar);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgp2b2lkIGZvbzIoVCYmIHZhbCkKewogICAgc3RhdGljX2Fzc2VydChzdGQ6OmlzX3NhbWU8aW50KiBjb25zdCwgVD46OnZhbHVlLCAibm90IHRoZSBzYW1lIik7Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CnZvaWQgZm9vKFQmIHZhbCkKewogICAgZm9vMihjb25zdF9jYXN0PFQgY29uc3Q+KHZhbCkpOwp9CgppbnQgbWFpbigpIHsKCWludCogYmFyOwogICAgZm9vKGJhcik7CglyZXR1cm4gMDsKfQ==