typedef void T;
 void f(T);

is only invalid in C++ mode, not C89 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49460 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 803f527..27825db 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -841,9 +841,9 @@
         // empty arg list, don't push any params.
         ParmVarDecl *Param = (ParmVarDecl*)FTI.ArgInfo[0].Param;
 
-        // In C++ and C89, the empty parameter-type-list must be
-        // spelled "void"; a typedef of void is not permitted. 
-        if (!getLangOptions().C99 &&
+        // In C++, the empty parameter-type-list must be spelled "void"; a
+        // typedef of void is not permitted.
+        if (getLangOptions().CPlusPlus &&
             Param->getType() != Context.VoidTy) {
           Diag(Param->getLocation(), diag::ext_param_typedef_of_void);
         }