Do distinct functions have distinct addresses?
Consider these two functions: void foo() {} void bar() {} is it guaranteed that &foo != &bar ? Similarly, template<class T> void foo() { } is it guaranteed that &foo<int> != &foo<double> ? There are two linkers I know of that fold function definitions together. MSVC aggressively COMDAT folds functions, so two functions with the same implementation can be turned into one function. As a side effect, the two functions share the same address. I was under the impression that this was illegal, but I cannot find where in the standard it is made illegal. The Gold linker also folds functions, with both