summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/statements.c
Commit message (Collapse)AuthorAgeFilesLines
* If a comma operator is followed by a token which unambiguously indicates theRichard Smith2012-09-181-0/+15
| | | | | | | | start of a statement or the end of a compound-statement, diagnose the comma as a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and minor refactoring by me. llvm-svn: 164085
* Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)Dmitri Gribenko2012-02-141-4/+4
| | | | | | | | | | | | | | * if, switch, range-based for: warn if semicolon is on the same line. * for, while: warn if semicolon is on the same line and either next statement is compound statement or next statement has more indentation. Replacing the semicolon with {} or moving the semicolon to the next line will always silence the warning. Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp. llvm-svn: 150515
* Don't skip past the '}' if an expression has error and is not followed by ';'.Argyrios Kyrtzidis2010-03-311-0/+5
| | | | llvm-svn: 99972
* Insulate these from changes to the default for -Wunreachable-code.Mike Stump2010-01-231-1/+1
| | | | llvm-svn: 94326
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Ok, ok, I give in. Fix tests for unused result warning.Daniel Dunbar2009-08-011-3/+3
| | | | llvm-svn: 77780
* Prep for new warning.Mike Stump2009-07-221-4/+4
| | | | llvm-svn: 76709
* change ParseStatementOrDeclaration to emit the 'missing ;' withChris Lattner2009-06-141-0/+3
| | | | | | | | | | | | | | | | | | | ExpectAndConsume instead of custom diag logic. This gets us an insertion hint and positions the ; at the end of the line instead of on the next token. Before: t.c:5:1: error: expected ';' after return statement } ^ after: t.c:4:11: error: expected ';' after return statement return 4 ^ ; llvm-svn: 73315
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix a couple of suboptimalities in error recovery.Chris Lattner2008-11-131-0/+7
| | | | | | | | | | | | | | | | | | | 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
* implement a fixme :), switch to -verify mode.Chris Lattner2008-11-131-6/+6
| | | | llvm-svn: 59253
* Split the expression tests out of statements.c into expressions.cChris Lattner2006-08-121-19/+0
| | | | llvm-svn: 38882
* Fix parsing of assignment expressions and handling of right-associativeChris Lattner2006-08-121-0/+4
| | | | | | things. llvm-svn: 38881
* Check that ?: parses its RHS as 'expression'.Chris Lattner2006-08-121-0/+4
| | | | llvm-svn: 38878
* Add another testcaseChris Lattner2006-08-111-0/+4
| | | | llvm-svn: 38870
* Add sizeof/cast/compound_expr tests.Chris Lattner2006-08-111-0/+8
| | | | llvm-svn: 38867
* Implement Parser/statements.c:test5: parsing decls that start with identifiersChris Lattner2006-08-101-0/+9
| | | | | | in blocks. llvm-svn: 38854
* Add support for simple labels.Chris Lattner2006-08-101-1/+1
| | | | llvm-svn: 38853
* Add support for parsing declarations in blocks. This implementsChris Lattner2006-08-101-0/+8
| | | | | | Parser/statements.c:test4 llvm-svn: 38852
* add test3Chris Lattner2006-08-101-0/+12
| | | | llvm-svn: 38850
* Refactor init-declarator-list parsing code to allow for-statements to haveChris Lattner2006-08-101-0/+1
| | | | | | initializers in them. llvm-svn: 38847
* add test2Chris Lattner2006-08-101-0/+12
| | | | llvm-svn: 38845
* new testcaseChris Lattner2006-08-091-0/+6
llvm-svn: 38843
OpenPOWER on IntegriCloud