[LLVMbugs] [Bug 9083] New: clang_getCursorLexicalParent() doesn't yield translation unit for global declarations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 28 07:09:32 PST 2011


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: unassignedclangbugs at nondot.org
        ReportedBy: stefan.seefeld at gmail.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list