id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5190,boost::phoenix operator+ sometimes returns a reference to a temporary leading to undefined behaviour,nicos@…,Joel de Guzman,"Compiling: {{{ const float x = 1.0f; const float y = 1.0f; std::cout << (arg1+arg2)(x,y); }}} with gcc results in the following warning: /usr/local/boost_1_45_0/boost/spirit/home/phoenix/operator/arithmetic.hpp:74: warning: returning reference to temporary The trouble is that result_of_plus::type is const float& instead of float. The source of the issue is that float is not supported ""natively"" by phoenix type deduction system ( if float is replaced by int, then the return type is correctly deduced ), the selected test overload is: {{{ template typename disable_if< is_basic , x_reference_type >::type test(X&); }}} As a result a reference to a temporary is returned that leads to undefined behaviour in programs compiled with heavy optimizations (-O3).",Bugs,closed,To Be Determined,phoenix,Boost 1.45.0,Showstopper,fixed,,