<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think you are not distinguishing properly between the declaration of the destructor and its usage (via a CXXMemberCallExpr) within the implementation/"body" of some other method declaration (this body should be enclosed in a "CompoundStmt"). <div class=""><br class=""></div><div class="">For example, the dump of </div><div class=""><br class=""></div><div class="">```</div><div class=""><font face="Menlo" class="">struct ColorTag {</font></div><div class=""><font face="Menlo" class="">  ~ColorTag() {}<br class="">  void destroy() {<br class="">    ColorTag::~ColorTag();<br class="">  }<br class="">};</font></div><div class=""><font face="Menlo" class="">```</font></div><div class=""><br class=""></div><div class="">looks like this:</div><div class=""><br class=""></div><div class="">```</div><div class=""><font face="Menlo" class="">TranslationUnitDecl<br class="">`-CXXRecordDecl <line:1:1, line:5:1> line:1:8 struct ColorTag definition<br class="">  ...(Definition data, implicitly-generated declarations)...</font></div><div class=""><div liberation="" mono",="" courier,="" monospace',="" menlo,="" monaco,="" 'courier="" new',="" monospace;font-weight:="" normal;font-size:="" 14px;line-height:="" 21px;white-space:="" pre;"="" style="background-color: rgb(255, 255, 254);" class=""><font face="Menlo" class="">  |-CXXDestructorDecl <line:2:5, col:18> col:5 used ~ColorTag 'void () noexcept'</font></div><font face="Menlo" class="">  |-CXXMethodDecl <line:2:5, line:4:5> line:2:10 destroy 'void ()'<br class="">  | `-CompoundStmt <col:20, line:4:5><br class="">  |   `-CXXMemberCallExpr <line:3:9, col:29> 'void'<br class="">  |     `-MemberExpr <col:9, col:20> '<bound member function type>' ->~ColorTag 0x55790cbbaa40<br class="">  |       `-CXXThisExpr <col:19> 'ColorTag *' implicit this<br class=""></font><div><font face="Menlo" class="">  ...</font></div><div>```</div><div><br class=""></div><div>Hope that helps, good luck,</div><div><br class=""></div><div>Dave</div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 29, 2020, at 10:40 AM, Billy Araujo via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">On project opentoonz there is a file called:</div><div class="">opentoonz/toonz/sources/image/pli/tags.cp<br class=""></div><div class=""><br class=""></div><div class="">If I run clang-check, the AST it builds seems wrong.</div><div class=""><br class=""></div><div class="">clang-check -ast-dump /home/opentoonz/toonz/sources/image/pli/tags.cpp | grep -B 1 -A 1 "~ColorTag"<br class=""></div><div class=""><br class=""></div><div class="">    |-CXXMemberCallExpr 0x22893e8 <line:253:1, col:21> 'void'<br class="">    | `-MemberExpr 0x22893a0 <col:1, col:12> '<bound member function type>' ->~ColorTag 0x2274c00<br class="">    |   `-CXXThisExpr 0x2289390 <col:11> 'ColorTag *' implicit this<br class=""></div><div class=""><br class=""></div><div class="">Line 253 appears as a CXXMemberCallExpr instead of a CXXDestructorDecl.</div><div class=""><br class=""></div><div class="">So the AST thinks it is calling an explicit destructor method call although it is a destructor implementation.</div><div class=""><br class=""></div><div class="">clang-check --version<br class="">LLVM (<a href="http://llvm.org/" class="">http://llvm.org/</a>):<br class="">  LLVM version 10.0.0<br class="">  <br class="">  Optimized build.<br class="">  Default target: x86_64-pc-linux-gnu<br class="">  Host CPU: nehalem<br class=""></div><div class=""><br class=""></div><div class="">Is this a bug or am I missing something?</div><div class=""><br class=""></div><div class="">Regards,</div><div class=""><br class=""></div><div class="">Billy.</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></div></body></html>