]> granicus.if.org Git - clang/commitdiff
C++ explicitly allows an empty source file.
authorChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 05:47:03 +0000 (05:47 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 05:47:03 +0000 (05:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41399 91177308-0d34-0410-b5e6-96231b3b80d8

Parse/Parser.cpp

index e4f1138521191f12ff373023ae11555bef90880d..255b48a7ca62a35b64c332fe78538dc9b0121a85 100644 (file)
@@ -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);
 }