K&R-style functions not allowed in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52575 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 84a1381..51223a7 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -420,8 +420,9 @@
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);