[cfe-dev] libclang: traversing initializers in for-range statements

Nikola Smiljanic popizdeh at gmail.com
Thu Mar 5 15:11:58 PST 2015


Sorry to hear this Jaeye, getting stuff in is sometimes a pain but I assure
you it's mostly because people are super busy. Patches in bugzilla usually
just rot, sending them to cfe-commits is the way to go. If they go
unnoticed for a week feel free to "ping" them, and make sure you CC someone
who's familiar with the code (svn blame).

On Thu, Mar 5, 2015 at 3:08 PM, jeaye <contact at jeaye.com> wrote:

> On Thu, Mar 05, 2015 at 02:15:24AM +0300, Дмитрий Ермолов wrote:
> > Hi,
> >
> > I'm trying to use libclang to parse some C++. When I parse source that
> includes for-range statement like:
> >
> >   int main() {
> >       char a[1000];
> >       for (auto x: a) { // <--- expect to traverse reference to `a` here
> >       ++x;
> >       }
> >   }
> >
> > I expect to traverse reference to `a` at some point, but it looks like
> such traversal never happens.
> >
> > Below is the example my traversal code in Python (actually I write in
> C++ but situation is similar there) and its output on the sample C++ source.
> >
> > Am I doing something wrong or such case is not supported by libclang?
> >
> > Thanks,
> > Dmitry
>
> Dmitry,
>
> I don't know about your specific case, but I've found multiple
> incomplete cursor traversal issues in libclang and I've reported them
> here (along with fixes and test code):
>
>
> http://llvm.org/bugs/buglist.cgi?quicksearch=incomplete%20traversal&list_id=68006
>
> So far, every single one has been ignored (tried IRC, the mailing list
> several
> months ago, and now these issues since January).
>
> In my experimentation, I did find there were issues with range-based for
> loops, as I've documented here:
>
> https://github.com/jeaye/color_coded/issues/2
>
> However, I found that specific issue was fixed some time in January.
> Still, I'm hoping that this thread can build momentum for the existing
> issues in libclang which have not been resolved for months.
>
> Cheers,
> Jeaye
>
> _______________________________________________
> 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/20150306/45c9ac8b/attachment.html>


More information about the cfe-dev mailing list