Is there a compiler warning that will catch code after a function returns?

Monday, May 12, 2014

given this function:



int doThings() {
int x = 1;
return x;
x + 1;
cout << "x: " << x << '\n';
}


Is there a compiler warning flag (g++ or clang++) that can catch the fact the code after return won't be run?







http://ift.tt/1ja3rQz