From 10ac7205ce1801cf5f6d90eb94cf38f37f99f8f3 Mon Sep 17 00:00:00 2001 From: Seth Cantrell Date: Fri, 13 Apr 2012 01:00:34 +0000 Subject: C++11 no longer requires files to end with a newline llvm-svn: 154643 --- clang/lib/Lex/Lexer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Lex/Lexer.cpp') diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index c817e3f1056..f0c2c8e4f68 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -2375,7 +2375,8 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { // C99 5.1.1.2p2: If the file is non-empty and didn't end in a newline, issue // a pedwarn. - if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) + if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r') + && !LangOpts.CPlusPlus0x) // C++11 [lex.phases] 2.2 p2 Diag(BufferEnd, diag::ext_no_newline_eof) << FixItHint::CreateInsertion(getSourceLocation(BufferEnd), "\n"); -- cgit v1.2.3