http://llvm.org/bugs/show_bug.cgi?id=9083

           Summary: clang_getCursorLexicalParent() doesn't yield
                    translation unit for global declarations
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


The documentation for clang_getCursorLexicalParent() states that, for
declarations in the global scope, the lexical parent is the translation unit
itself.

I couldn't reproduce this with any input. Specifically, I tried:

CXChildVisitResult my_visitor(CXCursor parent, CXCursor cursor, CXClientData d)
{
  ASGTranslator *translator = static_cast<ASGTranslator*>(d);

  CXCursor tu = clang_getTranslationUnitCursor(translator->tu_);
  CXCursor lp = clang_getCursorLexicalParent(c);
  std::cout << "lexical parent equals TU :" << clang_equalCursors(lp, tu) <<
std::endl;
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to