<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/126154/">https://git.reviewboard.kde.org/r/126154/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Can you create a unit test for this issue please?</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Also, couldn't this happen with more indirection in-between as well? I.e. is it safe enough to check the direct parent? Don't we need to check against a stack of parents to prevent recursion in all cases?</p></pre>
 <br />







<div>



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/126154/diff/1/?file=418115#file418115line136" style="color: black; font-weight: bold; text-decoration: underline;">languages/clang/codecompletion/completionhelper.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">FuncOverrideInfo processCXXMethod(CXCursor cursor, OverrideInfo* info)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">136</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k">if</span> <span class="p">(</span><span class="n">clang_equalCursors</span><span class="p">(</span><span class="n">ref</span><span class="p">,</span> <span class="n">parent</span><span class="p">))</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">join with next line</p></pre>
 </div>
</div>
<br />



<p>- Milian Wolff</p>


<br />
<p>On November 24th, 2015, 11:33 a.m. UTC, Maciej Cencora wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Maciej Cencora.</div>


<p style="color: grey;"><i>Updated Nov. 24, 2015, 11:33 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kdevelop
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The crash cannot be reproduced on completion, only when editing such class.
To reproduce:
1) create and save file with following content
template <typename Head, typename ...Tail>
struct my_class : Head, my_class<Tail...>
{
    using base = Head;
};
2) in line with 'using' statement, mark the 'Head' text
3) delete text
4) write something (e.g. press letter 'a')

Not sure whether this is proper fix, but backtrace shows infinite recursion.
#0  clang::operator<< (OS=..., N=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/lib/AST/DeclarationName.cpp:136
#1  0x00007fff7d266e9d in clang::NamedDecl::printName (this=<optimized out>, os=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/../../include/clang/AST/Decl.h:150
#2  getDeclSpelling (D=0x7fff9403bd00) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3491
#3  0x00007fff7d267686 in clang_getCursorSpelling (C=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3625
#4  0x00007fff7deb2e51 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5090) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:158
#5  0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f4f10, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
#6  0x00007fff7d25bc34 in clang::cxcursor::CursorVisitor::VisitTemplateParameters (this=this@entry=0x7fff7c8f4f10, Params=<optimized out>) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1321
#7  0x00007fff7d259235 in clang::cxcursor::CursorVisitor::VisitClassTemplateDecl (this=0x7fff7c8f4f10, D=0x7fff9403bef0) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:903
#8  0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f4f10, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
#9  0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5090)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
#10 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
#11 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5580) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
#12 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f5400, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
#13 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f5400, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
#14 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f5400, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
#15 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5580)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
#16 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
#17 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5a70) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
#18 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f58f0, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
#19 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f58f0, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
#20 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f58f0, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
#21 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5a70)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419
#22 0x00007fff7deb2dac in (anonymous namespace)::processBaseClass (cursor=..., parent=..., functionList=0x7fff74003590) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:148
#23 0x00007fff7deb2f42 in (anonymous namespace)::baseClassVisitor (cursor=..., parent=..., data=0x7fff7c8f5f60) at /home/mcencora/tmp/kdevelop/languages/clang/codecompletion/completionhelper.cpp:166
#24 0x00007fff7d259add in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7fff7c8f5de0, Cursor=..., CheckedRegionOfInterest=CheckedRegionOfInterest@entry=false)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:210
#25 0x00007fff7d25919a in clang::cxcursor::CursorVisitor::VisitCXXRecordDecl (this=0x7fff7c8f5de0, D=0x7fff9403be60) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:1672
#26 0x00007fff7d2595db in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7fff7c8f5de0, Cursor=...) at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:500
#27 0x00007fff7d260024 in clang_visitChildren (parent=..., visitor=0x7fff7deb2ddf <(anonymous namespace)::baseClassVisitor(CXCursor, CXCursor, CXClientData)>, client_data=0x7fff7c8f5f60)
    at /build/llvm-toolchain-3.6-18MJNr/llvm-toolchain-3.6-3.6.2/tools/clang/tools/libclang/CIndex.cpp:3419

... and this goes on for 39K frames</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Manual.</p></pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>languages/clang/codecompletion/completionhelper.cpp <span style="color: grey">(ac307ef)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/126154/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>