#include <iostream> #include <iomanip> using namespace std; struct Test { void f() && {}; }; int main() { Test t; t.f(); Test().f(); }
Standard input is empty
prog.cpp: In function ‘int main()’:
prog.cpp:14:9: error: passing ‘Test’ as ‘this’ argument discards qualifiers [-fpermissive]
t.f();
^
prog.cpp:8:10: note: in call to ‘void Test::f() &&’
void f() && {};
^
Standard output is empty