[cfe-dev] Getting diagnostic information from clang

Sean Silva chisophugis at gmail.com
Tue Jun 2 13:40:04 PDT 2015


On Tue, Jun 2, 2015 at 12:25 PM, Nate Wilson <nwilson20 at gmail.com> wrote:

> Hi,
>
> Is there any way to get information about where a diagnostic came from in
> clang, e.g. the source from which the Diagnostic was constructed? For
> example, when I try to assign to a member which doesn't exist in my
> class/struct, I get:
>
> error: no member named 'foo' in 'Bar'
>
> Is there anyway for clang to tell me where this Diagnostic came from?
>
Diagnostic::getLocation and Diagnostic::getRanges ?

-- Sean Silva


>
> Similarly, when the AST is constructed and I'm able to assign a value to
> foo, is there anyway for me to get the information about where the lookup
> is correctly found (for a data member in particular)?
>
> Or, do would I need to do some libAST tooling, get called back when a
> match is found, and debug from there?
>
> I'd appreciate any help.
>
> Thank you,
>
> Nate
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150602/471f987b/attachment.html>


More information about the cfe-dev mailing list