I forgot to mention two things:<div> * The remaining args passed to DiagnoseInvalidRedeclaration are, as far as I can tell, not able to be extracted from the other parameters.</div><div> * Since the ActOnFDArgs struct is down to 4 fields and DIR has only 3 other arguments, I am open to either keeping the struct or dropping it and moving its fields back into the parameter list for DIR.<div>
<br></div><div> - Kaelyn<br><br><div class="gmail_quote">On Thu, Sep 29, 2011 at 1:27 PM, Kaelyn Uhrain <span dir="ltr"><<a href="mailto:rikka@google.com">rikka@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Here are my patch for making DiagnoseInvalidRedeclaration not typo-correction a function name to one that will create additional compiler errors, along with several cleanup/refactoring patches.<br>
<br>
The refactoring in the second patch (the bool flag changes) was done to reduce how much extra data DiagnoseInvalidRedeclaration needs to be passed to be able to call Sema::ActOnFunctionDeclarator. It has the added bonus of making the parameter lists of several Sema methods less atrocious. :)<br>
<br>
Strictly speaking, the third patch (splitting up ActOnFunctionDeclarator a little) isn't needed by the other three patches. I'm including it here since it was a part of my work to trim down the extra arguments needed by DiagnoseInvalidRedeclaration, and it makes ActOnFunctionDeclarator a little less painful to examine.<br>
<br>
The fourth patch just removes a few of the extra args to ActOnFunctionDeclarator as the data is already in either the Declarator or the FunctionDecl (which I'd discovered while working on the previous two patches).<br>
<br>
Cheers,<br>
Kaelyn<br>
<br>
<br>
Kaelyn Uhrain (4):<br>
Only accept a typo correction if it doesn't trigger additional errors<br>
Move some bool flags out of function parameter lists.<br>
Move a couple chunks of ActOnFunctionDeclarator to separate functions<br>
Clean up DiagnoseInvalidRedeclaration a bit<br>
<br>
include/clang/Sema/DeclSpec.h | 17 +-<br>
include/clang/Sema/Sema.h | 33 +-<br>
lib/Parse/ParseCXXInlineMethods.cpp | 6 +-<br>
lib/Parse/ParseDeclCXX.cpp | 4 +-<br>
lib/Parse/Parser.cpp | 4 +-<br>
lib/Sema/SemaDecl.cpp | 674 +++++++++++++++++-------------<br>
lib/Sema/SemaDeclCXX.cpp | 20 +-<br>
lib/Sema/SemaTemplate.cpp | 6 +-<br>
lib/Sema/SemaTemplateInstantiateDecl.cpp | 13 +-<br>
test/SemaCXX/function-redecl.cpp | 5 +-<br>
10 files changed, 444 insertions(+), 338 deletions(-)<br>
<font color="#888888"><br>
--<br>
1.7.3.1<br>
</font></blockquote></div><br></div></div>