https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51066

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This warning would also help with this horror:
https://twitter.com/zygoloid/status/1367301323838812160

#include <stdio.h>
void f(float&&) { puts("float"); }
void f(int&&) { puts("int"); }
template<typename T> void g(T x) { f(x); }
int main() {
  g(1.0f);
  g(2);
}

Prints "int\nfloat\n" because f(x) cannot bind directly to an rvalue reference
so there is an implicit conversion.

Reply via email to