[cfe-dev] DeclContext::lookup() on a FunctionDecl

Sean Callanan scallanan at apple.com
Thu Aug 9 15:29:17 PDT 2012


I want to find a declaration of a struct that's declared in the body of a FunctionDecl.  The code looks like this:

DeclarationName struct_name(&m_ast_context->Idents.get(m_struct_name.c_str()));
FunctionDecl::lookup_result struct_lookup = F->lookup(struct_name);

When I call lookup() here, LookupPtr.getPointer() for the FunctionDecl is NULL and LookupPtr.getInt() is also NULL, so lookup() returns lookup_result(lookup_iterator(0), lookup_iterator(0)) without regard to what name I pass in.

Is there something wrong with this FunctionDecl, or is this expected behavior for FunctionDecls?

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120809/8d6aa5b8/attachment.html>


More information about the cfe-dev mailing list