bdrewery/bdlib — Issue #2: crashes with clang 1.9
Author: bdrewery
Created: 2011-12-16 05:22:54+00:00
State: open

When compiling with CLang, ```make distclean; MAKEJOBS="-j4" CXX="clang++" ./configure```, many of the String methods which return a local temporary value, cause a crash. CLang is causing the destructor to get called immediately after the return, instead of copying the value to the RValue of the caller. Stepping through the crash in CLang and then in g++ shows the clear distinction between working and non-working functionality.

1. http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/
2. http://www.parashift.com/c++-faq-lite/freestore-mgmt.html
3. http://en.wikipedia.org/wiki/Copy_elision
4. http://en.wikipedia.org/wiki/Return_value_optimization