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

           Summary: libclang does not respect line directives when
                    reporting source locations
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Given a simple file somefile.c with the contents

#123 "dummy.c" 1

static int func()
{
    return 0;
}

the source location of the func() definition is reported as line 3 of
somefile.c, whereas it should be line 124 of dummy.c as per the # directive.

The # line is correctly parsed in PPDirectives.cpp and a line note added, but
this is not available via the source location APIs.

This problem means that libclang's source location functionality is not much
use when processing files which have already been pre-processed, say via gcc
-E.

-- 
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