<div dir="ltr">On Wed, Sep 4, 2013 at 12:33 PM, Richard <span dir="ltr"><<a href="mailto:legalize@xmission.com" target="_blank">legalize@xmission.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
In article <<a href="mailto:CAJdarcHpLLjcXUgQzOpOQB0cuzTJQtehT%2BaggH_niAJFtRekQw@mail.gmail.com">CAJdarcHpLLjcXUgQzOpOQB0cuzTJQtehT+aggH_niAJFtRekQw@mail.gmail.com</a>>,<br>
<div class="im">    Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> writes:<br>
<br>
> On Tue, Sep 3, 2013 at 2:52 PM, Richard <<a href="mailto:legalize@xmission.com">legalize@xmission.com</a>> wrote:<br>
</div><div class="im">> > My questions for this audience are:<br>
> ><br>
> > 1) is this considered a "modernizing" transform that is appropriate<br>
> >    for clang-modernize?<br>
> ><br>
><br>
> Maybe?  Some people might consider it more of a style choice.<br>
<br>
</div>It is my understanding that the syntax "(void)" is for compatibility<br>
with C, where (void) is needed to explicitly say that a function takes<br>
no arguments and () is the legacy syntax used by older C code before<br>
function prototypes.<br>
<br>
Am I wrong?<br></blockquote><div><br></div><div>No, you're not wrong, but some people might consider it a style choice anyway, given that C++ has always worked that way.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
> > 2) how do I walk arbitrary type declarations like this without having<br>
> >    to re-invent parsing the type expressions?<br>
> ><br>
> > You walk type declarations using TypeSourceInfo: FunctionTypeLoc has<br>
> functions to retrieve the LParen and RParen locations for a function type<br>
> declaration.<br>
<br>
</div>The problem is that source locations just give me a position within<br>
the text, they don't give me smaller units of semantic structure that<br>
I can walk.  Finding the start and end positions in the source text is<br>
easy -- what I'm stumbling with is finding the corresponding parsed<br>
structure from that text.<br><br></blockquote><div><br></div><div>You can walk TypeSourceInfo: given a FunctionTypeLoc, you can get TypeLocs for the arguments, which you can then convert to FunctionTypeLocs, etc.<br><br>
</div><div>-Eli<br></div></div></div></div>