| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
llvm-svn: 99972
|
|
|
|
| |
llvm-svn: 94326
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
llvm-svn: 77780
|
|
|
|
| |
llvm-svn: 76709
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 59253
|
|
|
|
| |
llvm-svn: 38882
|
|
|
|
|
|
| |
things.
llvm-svn: 38881
|
|
|
|
| |
llvm-svn: 38878
|
|
|
|
| |
llvm-svn: 38870
|
|
|
|
| |
llvm-svn: 38867
|
|
|
|
|
|
| |
in blocks.
llvm-svn: 38854
|
|
|
|
| |
llvm-svn: 38853
|
|
|
|
|
|
| |
Parser/statements.c:test4
llvm-svn: 38852
|
|
|
|
| |
llvm-svn: 38850
|
|
|
|
|
|
| |
initializers in them.
llvm-svn: 38847
|
|
|
|
| |
llvm-svn: 38845
|
|
llvm-svn: 38843
|