He can:
int x = 3; int k = 0 * 3; std::cout << k; 00291000 mov ecx,dword ptr [__imp_std::cout (29203Ch)] 00291006 push 0 00291008 call dword ptr [__imp_std::basic_ostream<char,std::char_traits<char> >::operator<< (292038h)]
It even completely eliminates variables.
But this may not be the case:
struct X { friend void operator *(int first, const X& second) { std::cout << "HaHa! Fooled the optimizer!"; } };
source share