[cfe-dev] problem with the new AnnotateAttr

Jan Bierbaum s3306700 at inf.tu-dresden.de
Fri Aug 20 11:46:30 PDT 2010


Sean Hunt meinte am 20.08.2010 20:17:
>> 			dyn_cast<clang::AnnotateAttr>(attr)) {
> 
> Dereferencing the attr on this line should solve it.

It does indeed. Thanks a lot! :-)


> It seems there's a bug in dyn_cast for multi-level pointers - isa
> works on them and then cast does not, so you get garbage back.

That explains what I saw in the debugger - the address seems to be OK
(i.e. the same Sema put in the list) before the cast. But the whole
casting stuff Clang does is a little over my head for now. I'm quite new
to C++ anyway and even the iterators are something I have to get used to.


> Also, you may want to look at the new specific_attr_iterator interface, 
> which does the downcasting automatically.

Thanks for the hint, but I do need to iterate over all attributes and
just give the annotations a little extra treat.


Regards, Jan.



More information about the cfe-dev mailing list