http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46139
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-10-22 20:51:51 UTC --- I think this is invalid. The Standard talks exactly about the comparisons which we are doing, ie, assumes are well formed, both for lower_bound and for binary_search itself. Indeed, both the Dinkumware (the library delivered with the Microsoft compiler) and the Roguewave (the library delivered with SunStudio) implementations reject your snippets with the same error.