Yes:
#include <iostream>
#include <functional>
struct null_ref_t {
template <typename T>
operator T&() {
union TypeSafetyBreaker {
T *ptr;
// see https://stackoverflow.com/questions/38691282/use-of-union-with-reference
std::reference_wrapper<T> ref;
};
TypeSafetyBreaker ptr = {.ptr = nullptr};
// unwrap the reference
return ptr.ref.get();
}
};
null_ref_t nullref;
int main() {
int &a = nullref;
// Segmentation fault
a = 4;
return 0;
}