Unknown error perhaps caused by naming conflict?
<p>I wrote a very simple c++ code, where I defined a function called sqrt which just calls
std::sqrt. Unexpectedly, I got a segmentation fault. The problem doesn't exist if I rename
the function sqrt as something else. However, I can not see any naming conflict since
the sqrt function I defined is not in the namespace std so the two should be perfectly
separated. So what is the real cause of the problem? Thanks!</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;cmath&gt;

double sqrt(double d);

double sqrt(double d) {
    return std::sqrt(d);
}

int main() {
    double x = 3.0;
    std::cout &lt;&lt; "The square root of " &lt;&lt; x &lt;&lt; " is " &lt;&lt; sqrt(x) &lt;&lt; '\n';
    return 0;
}
</code></pre>
