From: Chris Lattner Date: Sat, 25 Aug 2007 05:47:03 +0000 (+0000) Subject: C++ explicitly allows an empty source file. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f72617544287acf0281c3b1a733bcb22a02e6ca4;p=clang C++ explicitly allows an empty source file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41399 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp index e4f1138521..255b48a7ca 100644 --- a/Parse/Parser.cpp +++ b/Parse/Parser.cpp @@ -245,7 +245,8 @@ void Parser::Initialize() { Actions.ParseDeclarator(CurScope, D, 0, 0); } - if (Tok.getKind() == tok::eof) // Empty source file is an extension. + if (Tok.getKind() == tok::eof && + !getLang().CPlusPlus) // Empty source file is an extension in C Diag(Tok, diag::ext_empty_source_file); }