[PATCH] Suggest fix-it for missing '{' after base-clause

Richard Smith richard at metafoo.co.uk
Mon Aug 11 11:14:51 PDT 2014


Is this sufficiently high-confidence for a fix-it? Maybe the problem is a missing `,`, or someone put `virtual` after the type, or similar. Maybe we failed to parse a base class template specialization and we're lost in the middle of a //template-argument-list//?

Let's try a bit harder to be sure here. How about checking for the next token being at the start of a line, and one of the following:

 * the next token is `public`, `protected`, or `private`, followed by a `:`
 * the next token is `static_assert`
 * the next tokens are a valid //simple-declaration// (see `Parser::isCXXSimpleDeclaration`)

http://reviews.llvm.org/D4848






More information about the cfe-commits mailing list