diff options
| author | Anna Zaks <ganna@apple.com> | 2011-07-22 23:08:19 +0000 |
|---|---|---|
| committer | Anna Zaks <ganna@apple.com> | 2011-07-22 23:08:19 +0000 |
| commit | c8eab671cf3f9d3fe19f87d0ede9451072ff9866 (patch) | |
| tree | 5b0bb61e3e1880d7be582fdd8be3be368abf4a0f | |
| parent | 6320f52ff4bfe3a8baf17cfb6950a503ec6b1f22 (diff) | |
| download | bcm5719-llvm-c8eab671cf3f9d3fe19f87d0ede9451072ff9866.tar.gz bcm5719-llvm-c8eab671cf3f9d3fe19f87d0ede9451072ff9866.zip | |
Expose no newline at end of file warning under Wnewline-eof flag.
llvm-svn: 135822
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticLexKinds.td | 3 | ||||
| -rw-r--r-- | clang/test/Lexer/newline-eof.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index 38d6a800165..b93912213ab 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -38,7 +38,8 @@ def ext_multi_line_bcpl_comment : Extension<"multi-line // comment">, def ext_bcpl_comment : Extension< "// comments are not allowed in this language">, InGroup<Comment>; -def ext_no_newline_eof : Extension<"no newline at end of file">; +def ext_no_newline_eof : Extension<"no newline at end of file">, + InGroup<DiagGroup<"newline-eof">>; def ext_backslash_newline_eof : Extension<"backslash-newline at end of file">; def ext_dollar_in_identifier : Extension<"'$' in identifier">; def charize_microsoft_ext : Extension<"@# is a microsoft extension">; diff --git a/clang/test/Lexer/newline-eof.c b/clang/test/Lexer/newline-eof.c new file mode 100644 index 00000000000..2f95dc7593c --- /dev/null +++ b/clang/test/Lexer/newline-eof.c @@ -0,0 +1,5 @@ +// RUN: %clang -fsyntax-only -Wnewline-eof -verify %s +// rdar://9133072 + +// The following line isn't terminated, don't fix it. +void foo() {} // expected-warning{{No newline at end of file}}
\ No newline at end of file |

