https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105511
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- I'm not sure if there's anything to fix; the manual says: In rare cases it is possible to get false positives. To silence this, wrap the expression in parentheses. For example, the following is treated as a template, even where m and N are integers: @smallexample void NotATemplate (my_class t) @{ int N = 5; bool test = t.m < N > (0); // Treated as a template. test = (t.m < N) > (0); // Same meaning, but not treated as a template. @} @end smallexample so return ascending ? (a.value < (*b).value) : a.value > (*b).value; prevents the warning.