Get the latest tech news
C++, Complexity, and Compiler Bugs
Exploration of C++ complexity with first-hand experience of compiler bugs
The complexity was the most obvious to me when I worked in Developer Experience and had to deal with compiler bugs that were impacting the whole company. The compiler is supposed to see the const and extend the lifetime of the temporary variable so it’s alive for the whole local scope which makes the reference valid as well. Then a few months later, this paper advocates for adding an exception and extending the lifetime of the temporary when assigned to a const reference.
Or read this on Hacker News