Current implementation of FunctionDecl::isDefined does not take into
account declarations that do not have a body, but it can be instantiated
from a templated definition. This behavior creates problems when
processing friend functions defined in class templates. For instance,
the code:
template<typename T> struct X { friend void f() {} }; X<int> xi; void f() {}
compiles successfully but must fail due to redefinition of f. The
declaration of the friend f is created when the containing template
X is instantiated, but it does not have a body as per 14.5.4p4
because f is not odr-used.
With this change the function Sema::CheckForFunctionRedefinition
considers functions with uninstantiated bodies as definitions.