Detect dangling references to temporary
Clang 3.9 extremely reuses memory used by temporaries. This code is UB (simplified code): template <class T> class my_optional { public: bool has{ false }; T value; const T& get_or_default(const T& def) { return has ? value : def; } }; void use(const std::string& s) { // ... } int main() { my_optional<std::string> m; // ... const std::string& s = m.get_or_default("default value"); use(s); // s is dangling if default returned } We have tons of code something like above ( my_optional is just a simple example to illustrate it). Because of UB all clang compiler since 3.9 starts to reuse this