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());
On Mon, Nov 28, 2011 at 10:07 PM, Chandler Carruth <[email protected]> wrote:
> Your commit message doesn't mention this other recovery change:
> On Mon, Nov 28, 2011 at 9:27 PM, Richard Smith <[email protected]>
> wrote:
>>
>> - if (Tok.is(tok::l_brace)) {
>> - // This recovery skips the entire function body. It would be nice
>> - // to simply call ParseFunctionDefinition() below, however Sema
>> - // assumes the declarator represents a function, not a typedef.
>> - ConsumeBrace();
>> - SkipUntil(tok::r_brace, true);
>> - } else {
>> - SkipUntil(tok::semi);
>> - }
>> - return 0;
>> + // Recover by ignoring the 'typedef'.
>> + DS.ClearStorageClassSpecs();
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits