diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-10 02:26:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-10 02:26:16 +0000 |
commit | def026a193b8218a58d112414515cb87fdf89c15 (patch) | |
tree | 520c20a306d18b30c2c55cd8975a63f3e83b9cc0 /lib/Sema/SemaDecl.cpp | |
parent | 8123a95c33b792d35c2e4992ba6e27882748fb0d (diff) |
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 803f527e50..27825dbef6 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -841,9 +841,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { // 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); } |