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 e4f1138..255b48a 100644
--- a/Parse/Parser.cpp
+++ b/Parse/Parser.cpp
@@ -245,7 +245,8 @@
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);
}