On Tue, Aug 5, 2014 at 3:16 PM, Olivier Goffart <[email protected]> wrote:
> Hi, > > This fixes a crash in the RecursiveASTVisitor on such code: > __typeof__(struct F*) var[invalid]; > > The main problem is that when the type is invalid, we don't even > try to generate TypeSourceInfo for it, which lead to a crash when we try > to visit them in the tools. > This is solved in SemaType.cpp by actually generating the TypeSourceInfo > even for invalid types. > I'm surprised by this: the code used to call getTrivialTypeSourceInfo in this case, which does create a TypeSourceInfo object. How do we end up with the TSI being null? > The second problem is that if there is an error parsing the size of the > array, we bail out without actually registering that it should have been an > array. Fix that Parser::ParseBracketDeclarator. > Move the check for invalid type a bit up in Sema::ActOnUninitializedDecl > in order to avoid unnecessary diagnostic This part looks fine. Is it possible to add a testcase for the improved recovery here, without the rest of the patch?
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
