Without this patch
for(std::set<int>::iterator it = s.begin(); ...)
is converted into
for(std::_Tree_const_iterator<std::_Tree_val<std::_Tree_simple_types<int>>>::value_type i : s)
With this patch the output is as expected:
for(int i : s)
Related bug: https://bugs.llvm.org/show_bug.cgi?id=36688