<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"\@Malgun Gothic";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:0cm;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:10.0pt;
        margin-left:36.0pt;
        line-height:115%;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:1867598659;
        mso-list-type:hybrid;
        mso-list-template-ids:-786553096 948218978 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-start-at:3;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:"Malgun Gothic";}
@list l0:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><span style="color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Does anyone have an idea how to get the parameter list of a C++ function using c-index-test.exe ?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">While it works for a C function, I get nothing which can be evaluated in case of C++ function.
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks for any answer,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Duc<o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal">
<b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> cfe-dev-bounces@cs.uiuc.edu [mailto:cfe-dev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Duc Nguyen<br>
<b>Sent:</b> Monday, August 27, 2012 10:00 AM<br>
<b>To:</b> cfe-dev@cs.uiuc.edu<br>
<b>Subject:</b> [cfe-dev] Question on C++ code completion - function parameter list<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Using c-index-test.exe I’m learning clang code completion for C++.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have an issue to get the current parameter list of a C++ function.  While it works for a C function, I get nothing which can be evaluated in case of C++ function.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> I use the following command line: <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">“c-index-test -code-completion-at=x.cpp:9:10 -x c++ -fsyntax-only -x.cpp”<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Where: <o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span lang="EN-US">“9:10” is the line:column number just after the parenthesis behind the function name.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">If the function is a C function, “c-index-test” returns a function parameter list for the function with the node ‘CurrentParameter’ which is important for code completion:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">NotImplemented:{ResultType int}{Text geti}{LeftParen (}{CurrentParameter int i}{Comma , }{Text char c}{RightParen )} (1)
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">But if I use the same command line asking for the C++ function parameter list, the expected result is not returned.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hereafter is the source code x.cpp:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;
color:blue">int</span><span style="font-size:9.5pt;font-family:Consolas"> geti(<span style="color:blue">int</span> i,
<span style="color:blue">char</span> c) { <span style="color:blue">return</span> 1; }  
<span style="color:green">// C function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;
color:blue">class</span><span style="font-size:9.5pt;font-family:Consolas"> myclass {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas;
color:blue">public</span><span style="font-size:9.5pt;font-family:Consolas">:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">  myclass() {}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">  ~myclass() {}<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">  <span style="color:blue">int</span> func(<span style="color:blue">int</span> i,
<span style="color:blue">char</span> c) { <span style="color:blue">return</span> 1; }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">  <span style="color:blue">void</span> test() {<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">    func(<span style="color:green">//line and column number for code completion here, after the parenthesis<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">  }<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal;text-autospace:none">
<span style="font-size:9.5pt;font-family:Consolas">};<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Could you please tell me, whether the command line to retrieve the parameter list for the C++ function differs from that in C?  And, which command line would be appropriate?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks for any answer and tips.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Duc</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;line-height:
normal">
<span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";
color:black">-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender
 immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.</span><span style="font-size:12.0pt;
font-family:"Times New Roman","serif""><o:p></o:p></span></p>
</div>
<br>
<font face="Arial" color="Black" size="2">-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents
 to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.<br>
</font>
</body>
</html>