rjmccall added a comment. CurFuncDecl is supposed to be the enclosing user function. Things like outlined functions should be getting stored in CurCodeDecl; that's how it's done for blocks and lambdas. http://reviews.llvm.org/D12614