<div dir="ltr">Hi Vladimir,<div><br></div><div>It looks to me that this is a bug. However, it currently seems to works because <span style="font-size:12.800000190734863px">ObjCInterfaceLocInfo is initialized through ObjCObjectTypeLoc so </span><span style="font-size:12.800000190734863px">ObjCObjectTypeLocInfo</span><span style="font-size:12.800000190734863px"> is valid, and after that we initialize </span><span style="font-size:12.800000190734863px">ObjCInterfaceTypeLocInfo. I guess that we don't really see the effect of the bug because we don't have tests that check for conflict between the name location from ObjCInterfaceTypeLocInfo and left angle/right angle locations from ObjCObjectTypeLoc. </span></div><div><span style="font-size:12.800000190734863px">I think that it would make sense for ObjCInterfaceTypeLoc to derive from </span><span style="font-size:12.800000190734863px">ObjCObjectTypeLoc directly.</span><span style="font-size:12.800000190734863px"> I'll try to</span><span style="font-size:12.800000190734863px"> clean it up.</span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">Alex</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 February 2017 at 16:34, Vladimir Voskresensky via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Clang experts,<br>
<br>
Could you help me, please, to understand how does ObjCInterfaceTypeLoc class suppose to work?<br>
ObjCInterfaceTypeLoc is the only one class in TypeLoc hierarchy which inherits twice from ConcreteTypeLoc.<br>
I see in source code and visually at<br>
<a href="http://ftp.llvm.org/doxygen/classclang_1_1ObjCInterfaceTypeLoc.html" rel="noreferrer" target="_blank">http://ftp.llvm.org/doxygen/cl<wbr>assclang_1_1ObjCInterfaceTypeL<wbr>oc.html</a><br>
<br>
It is derived from ObjCObjectTypeLoc (which uses ObjCObjectTypeLocInfo),<br>
but has own ObjCInterfaceLocInfo (passed as LocalData).<br>
Does it replace the ObjCObjectTypeLocInfo used by ObjCObjectTypeLoc?<br>
ObjCInterfaceLocInfo is not derived from ObjCObjectTypeLocInfo, so sizeof(ObjCInterfaceLocInfo) < sizeof(ObjCObjectTypeLocInfo)<br>
How methods of ObjCObjectTypeLoc can work for ObjCInterfaceTypeLoc instance?<br>
Shouldn't it be more like:<br>
<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeofLikeTypeLoc.html" rel="noreferrer" target="_blank">http://clang.llvm.org/doxygen/<wbr>classclang_1_1TypeofLikeTypeLo<wbr>c.html</a><br>
<br>
<br>
Thanks!<br>
Vladimir.<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>