id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12595,Unexpected result when using type_erased adaptor to a transformed_range when clang optimizations are enabled,Alfredo Altamirano ,Neil Groves,"If clang optimizations -O1 are enabled, when using type_erased adapter on a transformed_range, the range will yield wrong values. For example: int addOne(int b) { return b + 1; } int main() { std::vector nums{ 1, 2, 3 }; auto result = nums | boost::adaptor::transformed(addOne) | boost::adaptor::type_erased(); } When printing result, it yielded { 1, 1, 1 } instead of { 2, 3, 4 } when compiling with -O1. It worked as expected with no optimization flags. I am compiling the code with clang++. The version of clang is Apple LLVM version 8.0.0 (clang-800.0.38). And I am using c++11. http://stackoverflow.com/questions/40479397/getting-unexpected-result-when-compiling-with-clang-optimization?noredirect=1#comment68203492_40479397",Bugs,new,To Be Determined,range,Boost 1.61.0,Problem,,,