In the following example, we have a declaration of weakfoo before #pragma weak.
extern void weakfoo(); void localfoo() { } #pragma weak weakfoo=localfoo
There are two decls for weakfoo, this leads to assertion failure later (during search a decl for a call to weakfoo):
lib/Sema/SemaOverload.cpp:5583: void clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool): Assertion `Proto && "Functions without a prototype cannot be overloaded"' failed.
I suggest to call CheckFunctionDeclaration so that 2 decls for the weakfoo are merged.
If we're in this code, any chance you can also look at the other FIXME statements? If not, that's fine -- this is still positive movement. But it's usually best to tackle all of these at once while it's fresh in someone's mind what's happening here.