[cfe-dev] Problem obtaining the SourceRange of a BinaryOperator

Daniel QuiƱones Lopez kaos09 at hotmail.com
Mon Apr 28 02:16:24 PDT 2014


Hello,

I have a problem when trying to obtain the SourceRange of a BinaryOperator which RHS is a null pointer. Having something like "x = Null;", being x a pointer type variable, i can get the location of everything but the "Null", it seems like it doesn't exists. If I print the ast, the part referred to this is:

`-BinaryOperator 0xc750768 <line:7:5, /usr/local/bin/../lib/clang/3.4/include/stddef.h:72:18> 'char *' lvalue '='
| |     |-MemberExpr 0xc750728 <prueba.cpp:7:5> 'char *' lvalue ->x 0xc7505b0
| |     | `-CXXThisExpr 0xc750718 <col:5> 'class X *' this
| |     `-ImplicitCastExpr 0xc750758 </usr/local/bin/../lib/clang/3.4/include/stddef.h:72:18> 'char *' <NullToPointer>
| |       `-GNUNullExpr 0xc750748 <col:18> 'int'

But i don't see it clearly. Can someone help me with this?

Thank you.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140428/b3c28ef0/attachment.html>


More information about the cfe-dev mailing list