id summary reporter owner description type status milestone component version severity resolution keywords cc 7900 karma indirect_iterator returns reference to temporary Louis Dionne Hartmut Kaiser "Hello, The indirect_iterator in boost/spirit/home/karma/detail/indirect_iterator.hpp returns a reference to a temporary in at least one corner case. The compiler will issue a warning, but it's still UB. I attached the minimal code to reproduce the behavior as well as a fix. Without the fix, it will print crap and issue a warning (on Clang and GCC). What happens: I create a transformed_range, which uses a transform_iterator under the hood. Since the function performing the transformation returns by value, the the iterator_traits::reference type is NOT the same as iterator_traits::value_type const&, hence the return of a reference to a temporary. My setup: gcc version 4.7.2 clang version 3.2 boost-trunk@82516 Best, Louis Dionne " Patches closed To Be Determined spirit Boost Release Branch Problem fixed karma indirect_iterator