C++ explicitly allows an empty source file.

llvm-svn: 41399
This commit is contained in:
Chris Lattner 2007-08-25 05:47:03 +00:00
parent e33fbdb898
commit 66b67efa61
1 changed files with 2 additions and 1 deletions

View 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);
}