https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71136
--- Comment #3 from Tom Honermann <tom at honermann dot net> --- (In reply to Andrew Pinski from comment #2) > Hmm, clang and MSVC also reject the code in comment #1 (the one without the > bool) for the same reason as GCC. Interesting. Perhaps this is a common compiler bug? My reading of [expr.prim.id.general]p5 (http://eel.is/c++draft/expr.prim#id.general-5) and [over.over]p5 (http://eel.is/c++draft/over.over#5) suggests the code is intended to be valid. However, I'm no expert when it comes to the wording for overload resolution. >From [expr.prim.id.general]p5: > For an id-expression that denotes an overload set, overload resolution is > performed to select a unique function ([over.match], [over.over]). >From [over.over]p5: > ... Any given function template specialization F1 is eliminated if the set > contains a second function template specialization whose function template is > more specialized than the function template of F1 according to the partial > ordering rules of [temp.func.order]. After such eliminations, if any, there > shall remain exactly one selected function.