[cfe-commits] r145372 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseDecl.cpp lib/Parse/ParseTemplate.cpp test/FixIt/fixit-cxx0x.cpp test/FixIt/fixit.c test/FixIt/fixit.cpp test/SemaCXX/typedef-redecl.cpp

Richard Smith richard at metafoo.co.uk
Tue Nov 29 00:59:56 PST 2011


Hi,

> On Mon, Nov 28, 2011 at 10:07 PM, Chandler Carruth <chandlerc at google.com>
> wrote:
>> Your commit message doesn't mention this other recovery change:

Sorry about that! This other change was making the error-recovery for
templated function definitions with the 'typedef' specifier match the
error-recovery for the non-templated case.

On Tue, November 29, 2011 06:23, David Blaikie wrote:
> It'd also be rather easy to implement a fixit for this recovery too,
> just on the diagnostic a few lines above:
>
> Diag(Tok, diag::err_function_declared_typedef) <<
> FixItHint::CreateRemoval(DS.getStorageClassSpecLoc());

Yes, if we are suitably confident that removing the 'typedef' keyword is the
right fix. I think that is probably fine -- I've personally only ever seen
this happen once, and there the 'typedef' keyword was supposed to be
'typename' (which we will have already provided a separate fixit to add).

Richard




More information about the cfe-commits mailing list