From 66b67efa61e6b6310c86faa563fab8a071f6a57d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Aug 2007 05:47:03 +0000 Subject: [PATCH] C++ explicitly allows an empty source file. llvm-svn: 41399 --- clang/Parse/Parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/Parse/Parser.cpp b/clang/Parse/Parser.cpp index e4f113852119..255b48a7ca62 100644 --- a/clang/Parse/Parser.cpp +++ b/clang/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); }