hanchenye-llvm-project/clang/lib/Parse
Chris Lattner 0046de17e5 Fix a couple of suboptimalities in error recovery.
1. In the top level of ParseStatementOrDeclaration, don't eat a } if we
   just parsed a statement if it list there.  Also, don't even bother
   emitting an error about a missing semicolon if the statement had a 
   bug (an rbrace is fine).
2. In do/while parsing, don't require a 'while' to be present if the do
   body didn't parse.

This allows us to generate a clean diagnostic for this code:

t.c:1:22: error: expected expression
void foo (void) { do . while (0); }
                     ^

Thanks to Neil for pointing this out.

llvm-svn: 59256
2008-11-13 18:52:53 +00:00
..
AttributeList.cpp Add attribute always_inline support. 2008-10-28 00:17:57 +00:00
CMakeLists.txt CMake: Builds and installs clang binary and libs (no docs yet). It 2008-10-26 00:56:18 +00:00
DeclSpec.cpp Add support for parsing and representing C++ constructor declarations. 2008-10-31 09:07:45 +00:00
ExtensionRAIIObject.h implement a couple fixme's by implementing __extension__ properly. 2008-10-20 06:45:43 +00:00
Makefile
MinimalAction.cpp Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side. 2008-11-08 16:45:02 +00:00
ParseCXXInlineMethods.cpp Improve parser error recovery after a constructor initializer 2008-11-10 16:59:40 +00:00
ParseDecl.cpp Don't build identifiers for C++ constructors, destructors, or 2008-11-12 23:21:09 +00:00
ParseDeclCXX.cpp Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side. 2008-11-08 16:45:02 +00:00
ParseExpr.cpp Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types. 2008-11-11 17:56:53 +00:00
ParseExprCXX.cpp Implement C++ 'typeid' parsing and sema. 2008-11-11 11:37:55 +00:00
ParseInit.cpp Fix PR3001: if we have an error parsing an initializer, make sure to remove 2008-11-03 09:28:22 +00:00
ParseObjc.cpp some minor cleanups to ParseObjCTypeName: 2008-10-22 03:52:06 +00:00
ParsePragma.cpp Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParsePragma.h Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParseStmt.cpp Fix a couple of suboptimalities in error recovery. 2008-11-13 18:52:53 +00:00
ParseTentative.cpp Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side. 2008-11-08 16:45:02 +00:00
Parser.cpp Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side. 2008-11-08 16:45:02 +00:00