[cfe-commits] r135822 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td test/Lexer/newline-eof.c

Anna Zaks ganna at apple.com
Fri Jul 22 16:08:19 PDT 2011


Author: zaks
Date: Fri Jul 22 18:08:19 2011
New Revision: 135822

URL: http://llvm.org/viewvc/llvm-project?rev=135822&view=rev
Log:
Expose no newline at end of file warning under Wnewline-eof flag.

Added:
    cfe/trunk/test/Lexer/newline-eof.c
Modified:
    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td

Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=135822&r1=135821&r2=135822&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Fri Jul 22 18:08:19 2011
@@ -38,7 +38,8 @@
 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">;

Added: cfe/trunk/test/Lexer/newline-eof.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/newline-eof.c?rev=135822&view=auto
==============================================================================
--- cfe/trunk/test/Lexer/newline-eof.c (added)
+++ cfe/trunk/test/Lexer/newline-eof.c Fri Jul 22 18:08:19 2011
@@ -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





More information about the cfe-commits mailing list