Specifically, is the following legal C++?
class A{}; void foo(A*); void bar(const A&); int main(void) { foo(&A()); // 1 bar(A()); // 2 }
It a
for //2 you need a const reference
for //1 I think it's legal but useless