title: Why is it impossible to build a compiler that can determine if a C++ function will change the value of a particular variable?
body: <p>I read this line in a book: </p>
  
  <blockquote>
    <p>It is provably impossible to build a compiler that can actually
    determine whether or not a C++ function will change the value of a
    particular variable.</p>
  </blockquote>
  
  <p>The paragraph was talking about why the compiler is conservative when checking for const-ness. </p>
  
  <p><strong>Why is it impossible to build such a compiler?</strong> </p>
  
  <p>The compiler can always check if a variable is reassigned, a non-const function is being invoked on it, or if it is being passed in as a non-const parameter...</p>