while solving a test on http://cppquiz.org I found this interesting piece of code :
#include <iostream>
int f(int& a, int& b) {
a = 3;
b = 4;
return a + b;
}
int main () {
int a = 1;
int b = 2;
int c = f(a, a);// note a,a
std::cout << a << b << c;
}
My question is this program legal C++ or it isnt? Im concerned about strict aliasing.