Does redefining a function from the standard library violate the one-definition rule?
问题 #include <cmath> double log(double) {return 1.0;} int main() { log(1.0); } Suppose the function log() in <cmath> 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 log() function we defined. So does this code violate the one-definition rule (see here, since no diagnostic required, this code may compile in some compiler and we cannot assert if it is correct)? Note : After recent edits, this is not a