#include <iostream>
#include <string>
#include <type_traits>
template <class T>
T get()
{
static_assert(std::is_reference<T>::value, "");
const static std::string s = "abc";
return T(s);
}
int main()
{
std::string& s = get<std::string&>();
s = "blah"; // obviously undefined behavior!!
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+Cgp0ZW1wbGF0ZSA8Y2xhc3MgVD4KVCBnZXQoKQp7CglzdGF0aWNfYXNzZXJ0KHN0ZDo6aXNfcmVmZXJlbmNlPFQ+Ojp2YWx1ZSwgIiIpOwoJY29uc3Qgc3RhdGljIHN0ZDo6c3RyaW5nIHMgPSAiYWJjIjsKCXJldHVybiBUKHMpOwp9CgppbnQgbWFpbigpCnsKCXN0ZDo6c3RyaW5nJiBzID0gZ2V0PHN0ZDo6c3RyaW5nJj4oKTsKCXMgPSAiYmxhaCI7IC8vIG9idmlvdXNseSB1bmRlZmluZWQgYmVoYXZpb3IhIQp9Cg==