K&R-style functions not allowed in C++.

llvm-svn: 52575
This commit is contained in:
Argyrios Kyrtzidis 2008-06-21 10:00:56 +00:00
parent 42bbca11cc
commit e6aff3db25
1 changed files with 3 additions and 2 deletions

View File

@ -420,8 +420,9 @@ Parser::DeclTy *Parser::ParseDeclarationOrFunctionDefinition() {
Tok.is(tok::kw___attribute)) { // int X() __attr__ -> not a function def
// FALL THROUGH.
} else if (DeclaratorInfo.isFunctionDeclarator() &&
(Tok.is(tok::l_brace) || // int X() {}
isDeclarationSpecifier())) { // int X(f) int f; {}
(Tok.is(tok::l_brace) || // int X() {}
( !getLang().CPlusPlus &&
isDeclarationSpecifier() ))) { // int X(f) int f; {}
if (DS.getStorageClassSpec() == DeclSpec::SCS_typedef) {
Diag(Tok, diag::err_function_declared_typedef);