title: Does redefining a function from the standard library violate the one-definition rule?
body: <pre><code>#include &lt;cmath&gt;
  
  double log(double) {return 1.0;}
  int main() {
    log(1.0);
  }
  </code></pre>
  
  <p>Suppose the function <code>log()</code> in <code>&lt;cmath&gt;</code> is declared in global namespace (this is unspecified in fact, and we just make this assumption), then it refers to the same function as the <code>log()</code> function we defined.<br>
  So does this code violate the one-definition rule (see <a href="http://www.eel.is/c++draft/basic.def.odr#4" rel="nofollow noreferrer">here</a>, since no diagnostic required, this code may compile in some compiler and we cannot assert if it is correct)?</p>
  
  <p><strong>Note</strong>: After recent edits, this is not a duplicate of: <a href="https://stackoverflow.com/q/4192170/514235">What exactly is One Definition Rule in C++?</a></p>